diff --git a/CHANGELOG.md b/CHANGELOG.md
index 583e27acb..ce27fd83b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@ title: Changelog
### Features
- Introduced `generateOutputsBegin` and `generateOutputsEnd` events on `Application` for plugin use.
+- Group/category section headings (`
`) in the default theme now include an `id` attribute so they can be linked to via fragment identifiers (e.g. `modules.html#runtime-guards`), #3029.
## v0.28.19 (2026-04-12)
diff --git a/src/lib/output/themes/default/partials/index.tsx b/src/lib/output/themes/default/partials/index.tsx
index 8c1f03236..14fa70f3f 100644
--- a/src/lib/output/themes/default/partials/index.tsx
+++ b/src/lib/output/themes/default/partials/index.tsx
@@ -2,14 +2,22 @@ import { classNames, getMemberSections, isNoneSection, type MemberSection, rende
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
import { i18n, JSX } from "#utils";
import type { ContainerReflection } from "../../../../models/index.js";
+import { anchorIcon } from "./anchor-icon.js";
function renderSection(
- { urlTo, reflectionIcon, getReflectionClasses, markdown }: DefaultThemeRenderContext,
+ context: DefaultThemeRenderContext,
item: MemberSection,
) {
+ const { urlTo, reflectionIcon, getReflectionClasses, markdown, slugger } = context;
+ const sectionAnchor = !isNoneSection(item) ? slugger.slug(item.title) : undefined;
return (
- {!isNoneSection(item) && {item.title}
}
+ {!isNoneSection(item) && (
+
+ {item.title}
+ {anchorIcon(context, sectionAnchor)}
+
+ )}
{item.description && (
{context.icons.chevronDown()} -
+
{section.title} + {anchorIcon(context, sectionAnchor)}
{context.icons.chevronDown()} -
{content} diff --git a/src/test/renderer/specs/classes/BaseClass.json b/src/test/renderer/specs/classes/BaseClass.json index 47bf55a43..aa86f74ae 100644 --- a/src/test/renderer/specs/classes/BaseClass.json +++ b/src/test/renderer/specs/classes/BaseClass.json @@ -105,7 +105,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Constructors" + "h3.tsd-index-heading.tsd-anchor-link#constructors": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -126,7 +135,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Methods" + "h3.tsd-index-heading.tsd-anchor-link#methods": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -172,7 +190,16 @@ "data-key": "section-Constructors" }, "children": { - "h2": "Constructors" + "h2.tsd-anchor-link#constructors-1": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors-1", + "aria-label": "Permalink" + } + } + ] } }, { @@ -261,7 +288,16 @@ "data-key": "section-Methods" }, "children": { - "h2": "Methods" + "h2.tsd-anchor-link#methods-1": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/classes/GH3007.DOMBase.json b/src/test/renderer/specs/classes/GH3007.DOMBase.json index ce8d777d8..7efdbc745 100644 --- a/src/test/renderer/specs/classes/GH3007.DOMBase.json +++ b/src/test/renderer/specs/classes/GH3007.DOMBase.json @@ -96,7 +96,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Constructors" + "h3.tsd-index-heading.tsd-anchor-link#constructors": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -117,7 +126,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Methods" + "h3.tsd-index-heading.tsd-anchor-link#methods": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -153,7 +171,16 @@ "data-key": "section-Constructors" }, "children": { - "h2": "Constructors" + "h2.tsd-anchor-link#constructors-1": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors-1", + "aria-label": "Permalink" + } + } + ] } }, { @@ -317,7 +344,16 @@ "data-key": "section-Methods" }, "children": { - "h2": "Methods" + "h2.tsd-anchor-link#methods-1": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/classes/GH3007.DOMClass.json b/src/test/renderer/specs/classes/GH3007.DOMClass.json index 8bfe89f19..73271cca0 100644 --- a/src/test/renderer/specs/classes/GH3007.DOMClass.json +++ b/src/test/renderer/specs/classes/GH3007.DOMClass.json @@ -96,7 +96,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Methods" + "h3.tsd-index-heading.tsd-anchor-link#methods": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -131,7 +140,16 @@ "data-key": "section-Methods" }, "children": { - "h2": "Methods" + "h2.tsd-anchor-link#methods-1": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/classes/GH3014.json b/src/test/renderer/specs/classes/GH3014.json index f764dc955..11a7320a0 100644 --- a/src/test/renderer/specs/classes/GH3014.json +++ b/src/test/renderer/specs/classes/GH3014.json @@ -90,7 +90,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Constructors" + "h3.tsd-index-heading.tsd-anchor-link#constructors": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -125,7 +134,16 @@ "data-key": "section-Constructors" }, "children": { - "h2": "Constructors" + "h2.tsd-anchor-link#constructors-1": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/classes/GH3052.CustomPromise.json b/src/test/renderer/specs/classes/GH3052.CustomPromise.json index eab080c2e..93a2a87b8 100644 --- a/src/test/renderer/specs/classes/GH3052.CustomPromise.json +++ b/src/test/renderer/specs/classes/GH3052.CustomPromise.json @@ -115,7 +115,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Constructors" + "h3.tsd-index-heading.tsd-anchor-link#constructors": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -136,7 +145,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -167,7 +185,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Methods" + "h3.tsd-index-heading.tsd-anchor-link#methods": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -223,7 +250,16 @@ "data-key": "section-Constructors" }, "children": { - "h2": "Constructors" + "h2.tsd-anchor-link#constructors-1": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors-1", + "aria-label": "Permalink" + } + } + ] } }, { @@ -369,7 +405,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { @@ -454,7 +499,16 @@ "data-key": "section-Methods" }, "children": { - "h2": "Methods" + "h2.tsd-anchor-link#methods-1": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/classes/GH3052.PromiseReference.json b/src/test/renderer/specs/classes/GH3052.PromiseReference.json index ec1aaf43d..de3744589 100644 --- a/src/test/renderer/specs/classes/GH3052.PromiseReference.json +++ b/src/test/renderer/specs/classes/GH3052.PromiseReference.json @@ -70,7 +70,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Constructors" + "h3.tsd-index-heading.tsd-anchor-link#constructors": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -91,7 +100,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Methods" + "h3.tsd-index-heading.tsd-anchor-link#methods": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -137,7 +155,16 @@ "data-key": "section-Constructors" }, "children": { - "h2": "Constructors" + "h2.tsd-anchor-link#constructors-1": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors-1", + "aria-label": "Permalink" + } + } + ] } }, { @@ -226,7 +253,16 @@ "data-key": "section-Methods" }, "children": { - "h2": "Methods" + "h2.tsd-anchor-link#methods-1": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/classes/GenericClass.json b/src/test/renderer/specs/classes/GenericClass.json index beb540a5b..38e0a358a 100644 --- a/src/test/renderer/specs/classes/GenericClass.json +++ b/src/test/renderer/specs/classes/GenericClass.json @@ -100,7 +100,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Constructors" + "h3.tsd-index-heading.tsd-anchor-link#constructors": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -121,7 +130,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Methods" + "h3.tsd-index-heading.tsd-anchor-link#methods": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -163,7 +181,16 @@ "data-key": "section-Constructors" }, "children": { - "h2": "Constructors" + "h2.tsd-anchor-link#constructors-1": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors-1", + "aria-label": "Permalink" + } + } + ] } }, { @@ -347,7 +374,16 @@ "data-key": "section-Methods" }, "children": { - "h2": "Methods" + "h2.tsd-anchor-link#methods-1": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/classes/ModifiersClass.json b/src/test/renderer/specs/classes/ModifiersClass.json index e4650c528..f24db7e5c 100644 --- a/src/test/renderer/specs/classes/ModifiersClass.json +++ b/src/test/renderer/specs/classes/ModifiersClass.json @@ -59,7 +59,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Constructors" + "h3.tsd-index-heading.tsd-anchor-link#constructors": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -80,7 +89,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -146,7 +164,16 @@ "data-key": "section-Constructors" }, "children": { - "h2": "Constructors" + "h2.tsd-anchor-link#constructors-1": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors-1", + "aria-label": "Permalink" + } + } + ] } }, { @@ -269,7 +296,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/classes/RenderClass.json b/src/test/renderer/specs/classes/RenderClass.json index 47a7ca9ee..db216c540 100644 --- a/src/test/renderer/specs/classes/RenderClass.json +++ b/src/test/renderer/specs/classes/RenderClass.json @@ -146,7 +146,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Constructors" + "h3.tsd-index-heading.tsd-anchor-link#constructors": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -167,7 +176,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -188,7 +206,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Accessors" + "h3.tsd-index-heading.tsd-anchor-link#accessors": [ + "Accessors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#accessors", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -225,7 +252,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Methods" + "h3.tsd-index-heading.tsd-anchor-link#methods": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -281,7 +317,16 @@ "data-key": "section-Constructors" }, "children": { - "h2": "Constructors" + "h2.tsd-anchor-link#constructors-1": [ + "Constructors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#constructors-1", + "aria-label": "Permalink" + } + } + ] } }, { @@ -450,7 +495,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { @@ -525,7 +579,16 @@ "data-key": "section-Accessors" }, "children": { - "h2": "Accessors" + "h2.tsd-anchor-link#accessors-1": [ + "Accessors", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#accessors-1", + "aria-label": "Permalink" + } + } + ] } }, { @@ -788,7 +851,16 @@ "data-key": "section-Methods" }, "children": { - "h2": "Methods" + "h2.tsd-anchor-link#methods-1": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/enums/Enumeration.json b/src/test/renderer/specs/enums/Enumeration.json index 966a9f2d8..2f6e69c1a 100644 --- a/src/test/renderer/specs/enums/Enumeration.json +++ b/src/test/renderer/specs/enums/Enumeration.json @@ -97,7 +97,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Enumeration Members" + "h3.tsd-index-heading.tsd-anchor-link#enumeration-members": [ + "Enumeration Members", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#enumeration-members", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -142,7 +151,16 @@ "data-key": "section-Enumeration Members" }, "children": { - "h2": "Enumeration Members" + "h2.tsd-anchor-link#enumeration-members-1": [ + "Enumeration Members", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#enumeration-members-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/interfaces/BaseInterface.json b/src/test/renderer/specs/interfaces/BaseInterface.json index 984a18ba0..fe1110b22 100644 --- a/src/test/renderer/specs/interfaces/BaseInterface.json +++ b/src/test/renderer/specs/interfaces/BaseInterface.json @@ -140,7 +140,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Methods" + "h3.tsd-index-heading.tsd-anchor-link#methods": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -185,7 +194,16 @@ "data-key": "section-Methods" }, "children": { - "h2": "Methods" + "h2.tsd-anchor-link#methods-1": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/interfaces/ExpandType.ExpandedByDefault.json b/src/test/renderer/specs/interfaces/ExpandType.ExpandedByDefault.json index dd0a91628..f94d222fc 100644 --- a/src/test/renderer/specs/interfaces/ExpandType.ExpandedByDefault.json +++ b/src/test/renderer/specs/interfaces/ExpandType.ExpandedByDefault.json @@ -111,7 +111,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -146,7 +155,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/interfaces/GH2982.TMXDataNode.json b/src/test/renderer/specs/interfaces/GH2982.TMXDataNode.json index 4a14d5c79..9321cd683 100644 --- a/src/test/renderer/specs/interfaces/GH2982.TMXDataNode.json +++ b/src/test/renderer/specs/interfaces/GH2982.TMXDataNode.json @@ -191,7 +191,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -226,7 +235,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/interfaces/GH3007.DOMIterable.json b/src/test/renderer/specs/interfaces/GH3007.DOMIterable.json index e907f6478..8c77d4dab 100644 --- a/src/test/renderer/specs/interfaces/GH3007.DOMIterable.json +++ b/src/test/renderer/specs/interfaces/GH3007.DOMIterable.json @@ -177,7 +177,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -212,7 +221,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/interfaces/NoneCategory.json b/src/test/renderer/specs/interfaces/NoneCategory.json index 8f9f12a08..e914e9043 100644 --- a/src/test/renderer/specs/interfaces/NoneCategory.json +++ b/src/test/renderer/specs/interfaces/NoneCategory.json @@ -159,7 +159,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -180,7 +189,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties - Other" + "h3.tsd-index-heading.tsd-anchor-link#properties-other": [ + "Properties - Other", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-other", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -266,7 +284,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { @@ -333,7 +360,16 @@ "data-key": "section-Properties - Other" }, "children": { - "h2": "Properties - Other" + "h2.tsd-anchor-link#properties-other-1": [ + "Properties - Other", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-other-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/interfaces/NoneGroup.json b/src/test/renderer/specs/interfaces/NoneGroup.json index 925274d34..e9ffa3d41 100644 --- a/src/test/renderer/specs/interfaces/NoneGroup.json +++ b/src/test/renderer/specs/interfaces/NoneGroup.json @@ -138,7 +138,16 @@ { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -224,7 +233,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/interfaces/gh2995.json b/src/test/renderer/specs/interfaces/gh2995.json index c4182b433..08a32b93b 100644 --- a/src/test/renderer/specs/interfaces/gh2995.json +++ b/src/test/renderer/specs/interfaces/gh2995.json @@ -136,7 +136,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Methods" + "h3.tsd-index-heading.tsd-anchor-link#methods": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -177,7 +186,16 @@ "data-key": "section-Methods" }, "children": { - "h2": "Methods" + "h2.tsd-anchor-link#methods-1": [ + "Methods", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#methods-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/modules.json b/src/test/renderer/specs/modules.json index 2adb3a8e4..6f1a48c59 100644 --- a/src/test/renderer/specs/modules.json +++ b/src/test/renderer/specs/modules.json @@ -34,7 +34,16 @@ "data-key": "section-Documents" }, "children": { - "h2": "Documents" + "h2.tsd-anchor-link#documents": [ + "Documents", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#documents", + "aria-label": "Permalink" + } + } + ] } }, { @@ -78,7 +87,16 @@ "data-key": "section-Namespaces" }, "children": { - "h2": "Namespaces" + "h2.tsd-anchor-link#namespaces": [ + "Namespaces", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#namespaces", + "aria-label": "Permalink" + } + } + ] } }, { @@ -191,7 +209,16 @@ "data-key": "section-Enumerations" }, "children": { - "h2": "Enumerations" + "h2.tsd-anchor-link#enumerations": [ + "Enumerations", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#enumerations", + "aria-label": "Permalink" + } + } + ] } }, { @@ -235,7 +262,16 @@ "data-key": "section-Classes" }, "children": { - "h2": "Classes" + "h2.tsd-anchor-link#classes": [ + "Classes", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#classes", + "aria-label": "Permalink" + } + } + ] } }, { @@ -371,7 +407,16 @@ "data-key": "section-Interfaces" }, "children": { - "h2": "Interfaces" + "h2.tsd-anchor-link#interfaces": [ + "Interfaces", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#interfaces", + "aria-label": "Permalink" + } + } + ] } }, { @@ -507,7 +552,16 @@ "data-key": "section-Type Aliases" }, "children": { - "h2": "Type Aliases" + "h2.tsd-anchor-link#type-aliases": [ + "Type Aliases", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#type-aliases", + "aria-label": "Permalink" + } + } + ] } }, { @@ -574,7 +628,16 @@ "data-key": "section-Functions" }, "children": { - "h2": "Functions" + "h2.tsd-anchor-link#functions": [ + "Functions", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#functions", + "aria-label": "Permalink" + } + } + ] } }, { @@ -618,7 +681,16 @@ "data-key": "section-References" }, "children": { - "h2": "References" + "h2.tsd-anchor-link#references": [ + "References", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#references", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/modules/ExpandType.NestedBehavior1.json b/src/test/renderer/specs/modules/ExpandType.NestedBehavior1.json index c78078397..be6c5817d 100644 --- a/src/test/renderer/specs/modules/ExpandType.NestedBehavior1.json +++ b/src/test/renderer/specs/modules/ExpandType.NestedBehavior1.json @@ -48,7 +48,16 @@ "data-key": "section-Type Aliases" }, "children": { - "h2": "Type Aliases" + "h2.tsd-anchor-link#type-aliases": [ + "Type Aliases", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#type-aliases", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/modules/ExpandType.json b/src/test/renderer/specs/modules/ExpandType.json index dc9662dd9..30a94a879 100644 --- a/src/test/renderer/specs/modules/ExpandType.json +++ b/src/test/renderer/specs/modules/ExpandType.json @@ -37,7 +37,16 @@ "data-key": "section-Namespaces" }, "children": { - "h2": "Namespaces" + "h2.tsd-anchor-link#namespaces": [ + "Namespaces", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#namespaces", + "aria-label": "Permalink" + } + } + ] } }, { @@ -81,7 +90,16 @@ "data-key": "section-Interfaces" }, "children": { - "h2": "Interfaces" + "h2.tsd-anchor-link#interfaces": [ + "Interfaces", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#interfaces", + "aria-label": "Permalink" + } + } + ] } }, { @@ -125,7 +143,16 @@ "data-key": "section-Type Aliases" }, "children": { - "h2": "Type Aliases" + "h2.tsd-anchor-link#type-aliases": [ + "Type Aliases", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#type-aliases", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/modules/GH2982.json b/src/test/renderer/specs/modules/GH2982.json index 40c28d9dc..37b0049d0 100644 --- a/src/test/renderer/specs/modules/GH2982.json +++ b/src/test/renderer/specs/modules/GH2982.json @@ -37,7 +37,16 @@ "data-key": "section-Interfaces" }, "children": { - "h2": "Interfaces" + "h2.tsd-anchor-link#interfaces": [ + "Interfaces", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#interfaces", + "aria-label": "Permalink" + } + } + ] } }, { @@ -81,7 +90,16 @@ "data-key": "section-Type Aliases" }, "children": { - "h2": "Type Aliases" + "h2.tsd-anchor-link#type-aliases": [ + "Type Aliases", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#type-aliases", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/modules/GH3007.json b/src/test/renderer/specs/modules/GH3007.json index f409f158f..46154780d 100644 --- a/src/test/renderer/specs/modules/GH3007.json +++ b/src/test/renderer/specs/modules/GH3007.json @@ -37,7 +37,16 @@ "data-key": "section-Classes" }, "children": { - "h2": "Classes" + "h2.tsd-anchor-link#classes": [ + "Classes", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#classes", + "aria-label": "Permalink" + } + } + ] } }, { @@ -104,7 +113,16 @@ "data-key": "section-Interfaces" }, "children": { - "h2": "Interfaces" + "h2.tsd-anchor-link#interfaces": [ + "Interfaces", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#interfaces", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/modules/GH3052.json b/src/test/renderer/specs/modules/GH3052.json index 18e8423a3..df42dab3f 100644 --- a/src/test/renderer/specs/modules/GH3052.json +++ b/src/test/renderer/specs/modules/GH3052.json @@ -37,7 +37,16 @@ "data-key": "section-Classes" }, "children": { - "h2": "Classes" + "h2.tsd-anchor-link#classes": [ + "Classes", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#classes", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/types/ExpandType.AExpanded.json b/src/test/renderer/specs/types/ExpandType.AExpanded.json index 054638787..ed27145f5 100644 --- a/src/test/renderer/specs/types/ExpandType.AExpanded.json +++ b/src/test/renderer/specs/types/ExpandType.AExpanded.json @@ -169,7 +169,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -224,7 +233,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/types/ExpandType.BExpanded.json b/src/test/renderer/specs/types/ExpandType.BExpanded.json index 146e2c691..deed186c2 100644 --- a/src/test/renderer/specs/types/ExpandType.BExpanded.json +++ b/src/test/renderer/specs/types/ExpandType.BExpanded.json @@ -169,7 +169,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -224,7 +233,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/types/ExpandType.Expandable.json b/src/test/renderer/specs/types/ExpandType.Expandable.json index 9a12bb136..5f49fa98e 100644 --- a/src/test/renderer/specs/types/ExpandType.Expandable.json +++ b/src/test/renderer/specs/types/ExpandType.Expandable.json @@ -115,7 +115,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -150,7 +159,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/types/ExpandType.Expandable2.json b/src/test/renderer/specs/types/ExpandType.Expandable2.json index 5adbf8dbe..f2119002f 100644 --- a/src/test/renderer/specs/types/ExpandType.Expandable2.json +++ b/src/test/renderer/specs/types/ExpandType.Expandable2.json @@ -115,7 +115,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -150,7 +159,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AExpanded.json b/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AExpanded.json index 95b96b709..8c6c90a43 100644 --- a/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AExpanded.json +++ b/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AExpanded.json @@ -178,7 +178,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -233,7 +242,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AllExpanded.json b/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AllExpanded.json index df4424c35..99a736ad9 100644 --- a/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AllExpanded.json +++ b/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AllExpanded.json @@ -178,7 +178,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -233,7 +242,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, { diff --git a/src/test/renderer/specs/types/Nested.json b/src/test/renderer/specs/types/Nested.json index 18f04453c..0fbd65186 100644 --- a/src/test/renderer/specs/types/Nested.json +++ b/src/test/renderer/specs/types/Nested.json @@ -201,7 +201,16 @@ "div.tsd-accordion-details": { "section.tsd-index-section": [ { - "h3.tsd-index-heading": "Properties" + "h3.tsd-index-heading.tsd-anchor-link#properties": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties", + "aria-label": "Permalink" + } + } + ] }, { "div.tsd-index-list": [ @@ -236,7 +245,16 @@ "data-key": "section-Properties" }, "children": { - "h2": "Properties" + "h2.tsd-anchor-link#properties-1": [ + "Properties", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#properties-1", + "aria-label": "Permalink" + } + } + ] } }, {+
{section.title} + {anchorIcon(context, sectionAnchor)}