Table of contents
Starlight
Starlight already has this feature, so no additional work required. But you can override default one β
βSnakeβ table of contents
See:
Implementation
Checkout in the sourcecode how to implement:
- src/components/TOC.astro β
- src/components/TOCHelper.ts β
- src/components/TOCHeading.astro β
- src/toc.js β
TODO:
- fix bug: it crashes if there are missing header levels, like
h4
directly inh2
- fix βsnakeβ styles