Skip to content

Commit

Permalink
tools,doc: add "legacy" badge in the TOC
Browse files Browse the repository at this point in the history
PR-URL: #37949
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
aduh95 authored and MylesBorins committed Apr 4, 2021
1 parent 4ef102d commit 51e7a33
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions doc/api_assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 51e7a33

Please sign in to comment.