Skip to content

Commit 5ac4bf2

Browse files
committed
Move the responsability to the markdown parser
1 parent 48191a8 commit 5ac4bf2

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

docs/src/modules/components/MarkdownDocsV2.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default function MarkdownDocsV2(props) {
8181

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

8686
function createHookTocEntry(hookName, sectionName, hookProps = {}) {
8787
const hookPropToc = [];
@@ -275,11 +275,7 @@ export default function MarkdownDocsV2(props) {
275275
{commonElements}
276276
{activeTab === '' &&
277277
localizedDoc.rendered
278-
// for the "hook only" edge case, for example Base UI autocomplete
279-
.slice(
280-
i,
281-
localizedDoc.rendered.length - (localizedDoc.headers.components.length > 0 ? 1 : 0),
282-
)
278+
.slice(i)
283279
.map((renderedMarkdownOrDemo, index) => (
284280
<RichMarkdownElement
285281
key={`demos-section-${index}`}

packages/markdown/prepareMarkdown.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ This unstyled version of the component is the ideal choice for heavy customizati
110110
`);
111111
}
112112

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

0 commit comments

Comments
 (0)