|
| 1 | +diff --git a/node_modules/@microsoft/api-documenter/lib/documenters/MarkdownDocumenter.js b/node_modules/@microsoft/api-documenter/lib/documenters/MarkdownDocumenter.js |
| 2 | +index 716b861..853a6b1 100644 |
| 3 | +--- a/node_modules/@microsoft/api-documenter/lib/documenters/MarkdownDocumenter.js |
| 4 | ++++ b/node_modules/@microsoft/api-documenter/lib/documenters/MarkdownDocumenter.js |
| 5 | +@@ -893,12 +893,14 @@ class MarkdownDocumenter { |
| 6 | + } |
| 7 | + _writeBreadcrumb(output, apiItem) { |
| 8 | + const configuration = this._tsdocConfiguration; |
| 9 | +- output.appendNodeInParagraph(new tsdoc_1.DocLinkTag({ |
| 10 | +- configuration, |
| 11 | +- tagName: '@link', |
| 12 | +- linkText: 'Home', |
| 13 | +- urlDestination: this._getLinkFilenameForApiItem(this._apiModel) |
| 14 | +- })); |
| 15 | ++ // Don't print the first breadcrumb, because there's only one package, so we don't need the Home link. |
| 16 | ++ // output.appendNodeInParagraph(new tsdoc_1.DocLinkTag({ |
| 17 | ++ // configuration, |
| 18 | ++ // tagName: '@link', |
| 19 | ++ // linkText: 'Home', |
| 20 | ++ // urlDestination: this._getLinkFilenameForApiItem(this._apiModel) |
| 21 | ++ // })); |
| 22 | ++ let first = true; |
| 23 | + for (const hierarchyItem of apiItem.getHierarchy()) { |
| 24 | + switch (hierarchyItem.kind) { |
| 25 | + case api_extractor_model_1.ApiItemKind.Model: |
| 26 | +@@ -908,18 +910,24 @@ class MarkdownDocumenter { |
| 27 | + // this may change in the future. |
| 28 | + break; |
| 29 | + default: |
| 30 | +- output.appendNodesInParagraph([ |
| 31 | +- new tsdoc_1.DocPlainText({ |
| 32 | +- configuration, |
| 33 | +- text: ' > ' |
| 34 | +- }), |
| 35 | ++ if (!first) { |
| 36 | ++ // Only print the breadcrumb separator if it's not the first item we're printing. |
| 37 | ++ output.appendNodeInParagraph( |
| 38 | ++ new tsdoc_1.DocPlainText({ |
| 39 | ++ configuration, |
| 40 | ++ text: ' > ' |
| 41 | ++ }) |
| 42 | ++ ); |
| 43 | ++ } |
| 44 | ++ first = false; |
| 45 | ++ output.appendNodeInParagraph( |
| 46 | + new tsdoc_1.DocLinkTag({ |
| 47 | + configuration, |
| 48 | + tagName: '@link', |
| 49 | + linkText: hierarchyItem.displayName, |
| 50 | + urlDestination: this._getLinkFilenameForApiItem(hierarchyItem) |
| 51 | + }) |
| 52 | +- ]); |
| 53 | ++ ); |
| 54 | + } |
| 55 | + } |
| 56 | + } |
| 57 | +@@ -992,11 +1000,8 @@ class MarkdownDocumenter { |
| 58 | + // For overloaded methods, add a suffix such as "MyClass.myMethod_2". |
| 59 | + let qualifiedName = Utilities_1.Utilities.getSafeFilenameForName(hierarchyItem.displayName); |
| 60 | + if (api_extractor_model_1.ApiParameterListMixin.isBaseClassOf(hierarchyItem)) { |
| 61 | +- if (hierarchyItem.overloadIndex > 1) { |
| 62 | +- // Subtract one for compatibility with earlier releases of API Documenter. |
| 63 | +- // (This will get revamped when we fix GitHub issue #1308) |
| 64 | +- qualifiedName += `_${hierarchyItem.overloadIndex - 1}`; |
| 65 | +- } |
| 66 | ++ // https://github.com/microsoft/rushstack/issues/1921 |
| 67 | ++ qualifiedName += `_${hierarchyItem.overloadIndex}`; |
| 68 | + } |
| 69 | + switch (hierarchyItem.kind) { |
| 70 | + case api_extractor_model_1.ApiItemKind.Model: |
| 71 | +@@ -1007,7 +1012,8 @@ class MarkdownDocumenter { |
| 72 | + baseName = Utilities_1.Utilities.getSafeFilenameForName(node_core_library_1.PackageName.getUnscopedName(hierarchyItem.displayName)); |
| 73 | + break; |
| 74 | + default: |
| 75 | +- baseName += '.' + qualifiedName; |
| 76 | ++ // https://github.com/microsoft/rushstack/issues/1921 |
| 77 | ++ baseName += '.' + qualifiedName + '_' + hierarchyItem.kind.toLowerCase(); |
| 78 | + } |
| 79 | + } |
| 80 | + return baseName + '.md'; |
0 commit comments