Skip to content

Use AnchorJS to automatically generate heading anchors#700

Draft
nchammas wants to merge 3 commits into
apache:asf-sitefrom
nchammas:heading-anchors
Draft

Use AnchorJS to automatically generate heading anchors#700
nchammas wants to merge 3 commits into
apache:asf-sitefrom
nchammas:heading-anchors

Conversation

@nchammas

Copy link
Copy Markdown
Contributor

Right now if you look at a page on the main website like Useful Developer Tools, you'll notice that you cannot easily click on a heading and get an HTML anchor that will let you link directly to that section. On the other hand, if you look at the programming docs, you'll see that you can get anchor links by mousing over a heading.

This discrepancy is because the programming docs include AnchorJS, whereas the main website does not.

This PR adds AnchorJS to the main docs so readers can easily link to headings there like they can on the programming docs:

This adds the latest release of AnchorJS, which is 5.0.0. The programming docs are on AnchorJS 1.1.1, which is more than 11 years old. In a matching PR, I will update the programming docs to also use AnchorJS 5.0.0 so they are consistent.

I built the docs locally and confirmed that the anchors work as expected.

@nchammas

Copy link
Copy Markdown
Contributor Author

Because this touches global.html, the diff on the generated HTML is going to be massive. For this reason I'm going to wait until #699 is merged before asking for this to be formally reviewed and merged in.

@nchammas

Copy link
Copy Markdown
Contributor Author

cc @yaooqinn. As an example, this work here combined with the {:toc} kramdown directive would eliminate the need to manually add section ids or a table of contents as you had to do in #535.

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