v0.8.0
Table of Contents Support
Adds a "On This Page" table of contents sidebar for documentation pages, similar to Tailwind's docs.
Features
- Automatic TOC extraction from markdown H2 and H3 headings
- Scroll spy that highlights the current section as you scroll
- Smooth scroll navigation when clicking TOC items
- Proper handling of edge cases (bottom of page, URL hash on load)
- Right sidebar on xl+ screens (hidden on smaller viewports)
New Components
TableOfContents- Renders the TOC with scroll spy functionality
Changes
markdown.py- Addedslugify()andextract_toc()functionsMarkdown.tsx- Heading components now generate matching anchor IDsDocsLayout.tsx- Added right sidebar for TOC displayDocsPage.tsx- Passes TOC data to layouttypes.ts- AddedTOCItemandTableOfContentsPropstypes