diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index ae74848af6..34de576c7e 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -40,7 +40,7 @@ import { TSDocTagSyntaxKind, } from '@microsoft/tsdoc'; import { TSDocConfigFile } from '@microsoft/tsdoc-config'; -import { ApiPackage, ApiModel } from '@microsoft/api-extractor-model'; +import { ApiPackage, ApiModel, ApiItem } from '@microsoft/api-extractor-model'; import { IMarkdownDocumenterOptions, MarkdownDocumenter, @@ -939,6 +939,16 @@ async function buildDocs({ this._markdownEmitter = new CustomCustomMarkdownEmitter(newModel); } + private _getFilenameForApiItem(apiItem: ApiItem): string { + const filename: string = super._getFilenameForApiItem(apiItem); + + if (filename.endsWith('.html.md')) { + return `${filename.substring(0, filename.length - 8)}._html.md`; + } + + return filename; + } + // We don't really get many chances to modify the generated AST // so we hook in wherever we can. In this case we add the front matter // just before writing the breadcrumbs at the top.