Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add id attributes to heading elements #55

Merged
merged 1 commit into from
Aug 20, 2024
Merged

Add id attributes to heading elements #55

merged 1 commit into from
Aug 20, 2024

Conversation

chasenlehara
Copy link
Contributor

This changes the generated HTML to include id attributes on any heading (e.g. h3) elements.

Currently, bit-docs-html-toc will add id attributes when it parses the content and creates the TOC links. This means that JS has to be downloaded, parsed, and run before bit-docs-html-toc runs its code, and then there has to be more JS to scroll down to the right fragment.

This takes JS completely out of the equation by including the id attributes in the source HTML, so JS doesn’t need to load and bit-docs-html-toc isn’t required to make fragment URLs work either.

Part of https://bitovi.atlassian.net/browse/LD-203

This changes the generated HTML to include `id` attributes on any heading (e.g. `h3`) elements.

Currently, `bit-docs-html-toc` will add `id` attributes when it parses the content and creates the TOC links. This means that JS has to be downloaded, parsed, and run before `bit-docs-html-toc` runs its code, and _then_ there has to be more JS to scroll down to the right fragment.

This takes JS completely out of the equation by including the `id` attributes in the source HTML, so JS doesn’t need to load and `bit-docs-html-toc` isn’t required to make fragment URLs work either.

Part of https://bitovi.atlassian.net/browse/LD-203
@chasenlehara chasenlehara merged commit 8845dbf into master Aug 20, 2024
1 check passed
@chasenlehara chasenlehara deleted the html-ids branch August 20, 2024 18:01
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.

1 participant