Skip to content

feat(theme): add id attributes to group headings for linking#3072

Open
wotan-allfather wants to merge 2 commits intoTypeStrong:masterfrom
wotan-allfather:feat/group-heading-ids
Open

feat(theme): add id attributes to group headings for linking#3072
wotan-allfather wants to merge 2 commits intoTypeStrong:masterfrom
wotan-allfather:feat/group-heading-ids

Conversation

@wotan-allfather
Copy link

Add id attributes and anchor icons to group headings in the default theme, allowing users to link directly to specific groups in the documentation.

This includes:

  • h2 group headings in members.tsx (member groups)
  • h2 group headings in moduleReflection.tsx (module groups)
  • h3 group headings in index.tsx (index sections)

Example: modules.html#Runtime_Guards now links directly to that group.

Closes #3029

Add id attributes and anchor icons to group headings in the default theme,
allowing users to link directly to specific groups in the documentation.

This includes:
- h2 group headings in members.tsx (member groups)
- h2 group headings in moduleReflection.tsx (module groups)
- h3 group headings in index.tsx (index sections)

Example: modules.html#Runtime_Guards now links directly to that group.

Closes TypeStrong#3029
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Feb 13, 2026

Thank you!

Unfortunately this appears to have broken some things:

image

The caret icon for collapsed/expanded is no longer in place, and I don't see the anchor icon when hovering over the header, like I do when hovering over a header in the README:

image

The anchor icons weren't visible on hover because the headings
were missing the tsd-anchor-link class that enables the CSS hover
behavior.

- Add tsd-anchor-link class to h2 in members.tsx
- Add tsd-anchor-link class to h2 in moduleReflection.tsx
- Add tsd-anchor-link class to h3 in index.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Group headings in HTML output don't have id attributes for linking

2 participants

Comments