Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs-infra] Fix markdown version for material #41908

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions docs/src/modules/components/MarkdownDocsV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default function MarkdownDocsV2(props) {

const localizedDoc = docs[userLanguage] || docs.en;
// Generate the TOC based on the tab
const demosToc = localizedDoc.toc.filter((item) => item.text !== 'API');
const demosToc = localizedDoc.toc;

function createHookTocEntry(hookName, sectionName, hookProps = {}) {
const hookPropToc = [];
Expand Down Expand Up @@ -275,11 +275,7 @@ export default function MarkdownDocsV2(props) {
{commonElements}
{activeTab === '' &&
localizedDoc.rendered
// for the "hook only" edge case, for example Base UI autocomplete
.slice(
i,
localizedDoc.rendered.length - (localizedDoc.headers.components.length > 0 ? 1 : 0),
)
.slice(i)
.map((renderedMarkdownOrDemo, index) => (
<RichMarkdownElement
key={`demos-section-${index}`}
Expand Down
2 changes: 1 addition & 1 deletion packages/markdown/prepareMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ This unstyled version of the component is the ideal choice for heavy customizati
`);
}

if (headers.components.length > 0) {
if (headers.components.length > 0 && headers.productId !== 'base-ui') {
contents.push(`
## API

Expand Down
Loading