tools,doc: add "legacy" badge in the TOC

PR-URL: https://github.com/nodejs/node/pull/37949
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Antoine du Hamel authored and James M Snell committed 2021-04-01 12:31:25 -07:00
1 parent 25e30005b8
commit e8b1ea4ee2
2 files changed
+11 -3

No files matched your search

+8
View File
@@ -515,6 +515,14 @@ hr {
padding: 1px 3px;
border-radius: 3px;
}
#toc .stability_3::after {
background-color: var(--blue1);
color: var(--white);
content: "legacy";
margin-left: .25rem;
padding: 1px 3px;
border-radius: 3px;
}
#apicontent li {
margin-bottom: .5rem;
+3 -3
View File
@@ -265,9 +265,9 @@ function preprocessElements({ filename }) {
const [, prefix, number, explication] =
text.value.match(STABILITY_RE);
const isStabilityIndex =
index - 2 === headingIndex || // General.
index - 3 === headingIndex; // With api_metadata block.
// Stability indices are never more than 3 nodes away from their
// heading.
const isStabilityIndex = index - headingIndex <= 3;
if (heading && isStabilityIndex) {
heading.stability = number;