Links to headings in docs

As a maintainer I am often linking to specific headings in the Exercism documentation. This is possible because each heading has an id attribute in the DOM, but I have go to the HTML source to retrieve it, which is cumbersome.

It would be nice if the documentation pages have some clickable element to navigate to a specific heading, so that retrieving a link to a heading is as easy as right-clicking and selecting Copy Link.

The easiest and most non-intrusive way of doing this with respect to the website design would be to wrap the headings in anchors linking to themselves, or adding a small on-hover element similar to this: Install IntelliJ IDEA | IntelliJ IDEA Documentation.

Alternatively, adding a ToC to the top of each page would also work, but that does consume valuable screen space…

1 Like

Something for you @dem4ron

This PR will attach copy-buttons to docs headers:

3 Likes

That looks awesome!! :clap:

This has been merged. Will go live soon!

2 Likes

This is a great feature, but it’s not quite working for me yet.

When clicking on such a link with a heading id, the page still loads to the very top. It would be nice, and I assume this is the intended behavior, if such a link jumps to the relevant section on the page.

Example link with heading id for testing:

CC @dem4ron

Thanks for reporting, this PR will fix this issue:

This one finally got deployed. (The deploy server ran out of HDD space :slight_smile: )

1 Like