The #mystParser #Python package has a directive that allows you to place a table of contents at the top of your document, and the default behavior for this directive is to
1. create a table of contents 🙂↕️
2. make links from the table of contents to the appropriate heading 🙂↕️
3. add links to all the headings that go back to the table of contents 🫤
The effect is a bit jarring if you randomly click on a heading link expecting it to be the anchor, which is exemplified pretty well in the documentation for this feature:
https://myst-parser.readthedocs.io/en/latest/syntax/organising_content.html#document-structure