markdown-toc
markdown-toc copied to clipboard
Suggestion: a way to ignore certain headings
It would be nice to have some sort of way to ignore certain headers and omit them from the TOC. In my example below, the TOC is in the Contents section, so it doesn't really need to be included.
One idea might be to optionally ignore sections containing the TOC itself. Another might be some syntax similar to:
## Contents <!-- TOC omit:true -->
It's not really a big deal, but would be nice.
Thank your for your advice, it's a good idea, i will add it when version 1.6.0~
Would be great to have 1.6.0 released in the store! Thanks for implementing it!
So 1.6.0 is not released yet?
This feature seems to appear in the source code:
https://github.com/AlanWalk/markdown-toc/blob/c9cddf99543ca1eb40e17b46d5bd69bb330d8d07/src/extension.ts#L27
However, writing something like this does not work
## Table of Contents <!-- TOC ignore:true -->
<!-- TOC depthFrom:2 -->
...
<!-- /TOC -->
Seems like the because of #50, <!-- TOC ignore:true -->
is interpreted as just <!-- TOC -->
with some wrong parameters and the result becomes:
<!-- TOC -->
...
<!-- /TOC -->
(the header as well as anything between it and /TOC
gets erased)
@AlanWalk would you be happy to accept a PR and release a new version?