mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
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:
parent
4ef102d34e
commit
51e7a33d54
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user