Skip to content

Commit 51e7a33

Browse files
aduh95MylesBorins
authored andcommitted
tools,doc: add "legacy" badge in the TOC
PR-URL: #37949 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 4ef102d commit 51e7a33

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

doc/api_assets/style.css

+8
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,14 @@ hr {
515515
padding: 1px 3px;
516516
border-radius: 3px;
517517
}
518+
#toc .stability_3::after {
519+
background-color: var(--blue1);
520+
color: var(--white);
521+
content: "legacy";
522+
margin-left: .25rem;
523+
padding: 1px 3px;
524+
border-radius: 3px;
525+
}
518526

519527
#apicontent li {
520528
margin-bottom: .5rem;

tools/doc/html.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,9 @@ function preprocessElements({ filename }) {
265265
const [, prefix, number, explication] =
266266
text.value.match(STABILITY_RE);
267267

268-
const isStabilityIndex =
269-
index - 2 === headingIndex || // General.
270-
index - 3 === headingIndex; // With api_metadata block.
268+
// Stability indices are never more than 3 nodes away from their
269+
// heading.
270+
const isStabilityIndex = index - headingIndex <= 3;
271271

272272
if (heading && isStabilityIndex) {
273273
heading.stability = number;

0 commit comments

Comments
 (0)