Skip to content

Commit

Permalink
fix(docs): Map @alpha tags to "Legacy" alerts in API documentation (#…
Browse files Browse the repository at this point in the history
…21525)

In our repo, we are currently using the `@alpha` release tag to mean
something different than "alpha". We currently map it to a concept we're
calling "legacy". This PR updates the generated API docs to use "Legacy"
terminology in various tables in the API docs, instead of "Alpha" to
avoid any customer confusion.

In the future, we plan on reclaiming `@alpha` for its traditional
meaning, and using a `@legacy` tag for the special concept. The
configurations changed here will be need to changed again at that time.

Before

![image](https://github.com/microsoft/FluidFramework/assets/54606601/95f14088-5620-4ad6-834a-acdda73ce274)

After

![image](https://github.com/microsoft/FluidFramework/assets/54606601/29d039fa-c448-41f1-9beb-c5bcf4d7c002)


[AB#8406](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/8406)
  • Loading branch information
Josmithr authored Jun 20, 2024
1 parent c6b1941 commit fc86a15
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
17 changes: 17 additions & 0 deletions docs/api-markdown-documenter/render-api-documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import {
ApiItemKind,
ApiItemUtilities,
DocumentationNodeType,
getApiItemTransformationConfigurationWithDefaults,
loadModel,
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions docs/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fc86a15

Please sign in to comment.