markdown-viewer
markdown-viewer copied to clipboard
Feature request: better Table of Contents (collapsible, auto-scroll, only some headings etc.)
Hi, first of all, thanks for this amazing extension 💛
It would be great to have some more features in the Table of Contents:
Auto scroll
- As one scrolls the page, the TOC should also scroll to that respective heading's position.
- This is enabled on several websites (e.g., Vue), and even in VS Code
- Maybe it can be achieved using Intersection Observer
Collapsible Headings
- For a document with several headings, the TOC can become very long.
- So, it would be great to collapse the TOC to show only upto a certain heading, i.e. H2 or H3
- It can be achieved by simply using
details
tag in the TOC's headings texts.
TOC Headings option
- If the collapsible option is present, then that's great
- If not, then the extension should an option to choosing the order up to which headings should be generated.
- E.g., one may not need H5 or H6 headings to clutter the TOC.
Thanks once again.
These are all really great suggestions, thank you!
#190 I implemented the collapsible toc, I'm using it for a while now and it's really useful when the toc is big.
The Auto Scroll item was fixed in v5.1