Skip to content

Commit

Permalink
[docs-infra] Fix markdown version for material (#41908)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette authored Apr 17, 2024
1 parent 7c7fd30 commit 5baf601
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
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

0 comments on commit 5baf601

Please sign in to comment.