I strongly advise against manually building a table of contents. It's a pain to make them, and even more of a pain to maintain them.
Instead, let software take care of this for you. Here are two GitBook plugins that I just found for making tables of contents:
- https://www.npmjs.com/package/gitbook-plugin-page-toc
- https://www.npmjs.com/package/gitbook-plugin-simple-page-toc
Plugins can be enabled within the editor or by editing the book.json file.
Is it possible to add internal absolute links?
Is it possible to add internal links?
Broken Internal Links Render as GitHub URLs Instead of Showing Error
Relative links inside a page don't get transformed into links ending with html on windows version 2.0.1
I strongly advise against manually building a table of contents. It's a pain to make them, and even more of a pain to maintain them.
Instead, let software take care of this for you. Here are two GitBook plugins that I just found for making tables of contents:
- https://www.npmjs.com/package/gitbook-plugin-page-toc
- https://www.npmjs.com/package/gitbook-plugin-simple-page-toc
Plugins can be enabled within the editor or by editing the book.json file.
I know this question was asked a long time ago. Just in case anyone come across this because there is no official docs for this:
You could define your custom anchor to a header using the syntax ## My heading {#my-anchor} and reference it normally with my text. This will show the heading correctly as My heading and navigation will work properly.