diff --git a/repo-scripts/api-documenter/src/documenters/MarkdownDocumenter.ts b/repo-scripts/api-documenter/src/documenters/MarkdownDocumenter.ts index 313ce12e2fd..9014563e885 100644 --- a/repo-scripts/api-documenter/src/documenters/MarkdownDocumenter.ts +++ b/repo-scripts/api-documenter/src/documenters/MarkdownDocumenter.ts @@ -918,6 +918,11 @@ export class MarkdownDocumenter { } } + if (functionsTable.rows.length > 0) { + output.push(new DocHeading({ configuration, title: 'Functions' })); + output.push(functionsTable); + } + if (classesTable.rows.length > 0) { output.push(new DocHeading({ configuration, title: 'Classes' })); output.push(classesTable); @@ -927,10 +932,6 @@ export class MarkdownDocumenter { output.push(new DocHeading({ configuration, title: 'Enumerations' })); output.push(enumerationsTable); } - if (functionsTable.rows.length > 0) { - output.push(new DocHeading({ configuration, title: 'Functions' })); - output.push(functionsTable); - } if (interfacesTable.rows.length > 0) { output.push(new DocHeading({ configuration, title: 'Interfaces' })); diff --git a/repo-scripts/api-documenter/src/toc.ts b/repo-scripts/api-documenter/src/toc.ts index 2b71f3c8922..03c9cc66b00 100644 --- a/repo-scripts/api-documenter/src/toc.ts +++ b/repo-scripts/api-documenter/src/toc.ts @@ -73,6 +73,7 @@ function generateTocRecursively( addFileNameSuffix: boolean, toc: ITocItem[] ) { + // generate toc item only for entry points if (apiItem.kind === ApiItemKind.EntryPoint) { // Entry point const entryPointName = (apiItem.canonicalReference @@ -83,20 +84,6 @@ function generateTocRecursively( section: [] }; - for (const member of apiItem.members) { - // only classes and interfaces have dedicated pages - if ( - member.kind === ApiItemKind.Class || - member.kind === ApiItemKind.Interface - ) { - const fileName = getFilenameForApiItem(member, addFileNameSuffix); - entryPointToc.section!.push({ - title: member.displayName, - path: `${g3Path}/${fileName}` - }); - } - } - toc.push(entryPointToc); } else { // travel the api tree to find the next entry point