diff --git a/doc/api_assets/style.css b/doc/api_assets/style.css index 04299595ca80d6..3176b7db252049 100644 --- a/doc/api_assets/style.css +++ b/doc/api_assets/style.css @@ -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; diff --git a/tools/doc/html.js b/tools/doc/html.js index 9089ce7e443232..671cb4adf62065 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -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;