diff --git a/docs/api-markdown-documenter/render-api-documentation.js b/docs/api-markdown-documenter/render-api-documentation.js index d6a59d8e6c5a..385a944404d4 100644 --- a/docs/api-markdown-documenter/render-api-documentation.js +++ b/docs/api-markdown-documenter/render-api-documentation.js @@ -5,6 +5,7 @@ import { ApiItemKind, + ApiItemUtilities, DocumentationNodeType, getApiItemTransformationConfigurationWithDefaults, loadModel, @@ -80,6 +81,22 @@ export async function renderApiDocumentation(inputDir, outputDir, uriRootDir, ap includeBreadcrumb: false, // Hugo will now be used to generate the breadcrumb includeTopLevelDocumentHeading: false, // This will be added automatically by Hugo createDefaultLayout: layoutContent, + getAlertsForItem: (apiItem) => { + const alerts = []; + if (ApiItemUtilities.isDeprecated(apiItem)) { + alerts.push("Deprecated"); + } + + const releaseTag = ApiItemUtilities.getReleaseTag(apiItem); + if (releaseTag === ReleaseTag.Alpha) { + // Temporary workaround for the current `@alpha` => "Legacy" state. + // This should be replaced with "Alpha" once that has been cleaned up. + alerts.push("Legacy"); + } else if (releaseTag === ReleaseTag.Beta) { + alerts.push("Beta"); + } + return alerts; + }, skipPackage: (apiPackage) => { const packageName = apiPackage.displayName; const packageScope = PackageName.getScope(packageName); diff --git a/docs/package.json b/docs/package.json index f155a557b48b..c86d35c65d18 100644 --- a/docs/package.json +++ b/docs/package.json @@ -39,7 +39,7 @@ "start": "hugo server" }, "dependencies": { - "@fluid-tools/api-markdown-documenter": "^0.13.0", + "@fluid-tools/api-markdown-documenter": "^0.14.0", "@fluid-tools/markdown-magic": "file:../tools/markdown-magic", "@fluidframework/build-common": "^2.0.3", "@rushstack/node-core-library": "^4.0.2", diff --git a/docs/pnpm-lock.yaml b/docs/pnpm-lock.yaml index 90f0d07ecbab..f2514a90ac5b 100644 --- a/docs/pnpm-lock.yaml +++ b/docs/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@fluid-tools/api-markdown-documenter': - specifier: ^0.13.0 - version: 0.13.0 + specifier: ^0.14.0 + version: 0.14.0 '@fluid-tools/markdown-magic': specifier: file:../tools/markdown-magic version: file:../tools/markdown-magic(@tylerbu/markdown-magic@2.4.0-tylerbu-1) @@ -146,8 +146,8 @@ packages: regenerator-runtime: 0.13.11 dev: false - /@fluid-tools/api-markdown-documenter@0.13.0: - resolution: {integrity: sha512-cMUUjgaEWKF2xMmlE9pQ1NjHYZC+BCNiFSkerEnBqanSfGMznOSMmgCdXvwqrO0ennGAkK2bNJd6NWISUvZoLw==} + /@fluid-tools/api-markdown-documenter@0.14.0: + resolution: {integrity: sha512-KraqtlzpA/LyCRKD1fs7DWb1rQVsdxCYv2GFr8AALumU56vRv99o6FXX+NcyJUW9qrtmGBiQlwvfoMI66n06eA==} dependencies: '@microsoft/api-extractor-model': 7.28.2 '@microsoft/tsdoc': 0.14.2