MacDownApp / macdown

Open source Markdown editor for macOS.
https://macdown.uranusjr.com/
9.43k stars 1.09k forks source link

TOC-Tag for specified levels #910

Open C8-DO opened 6 years ago

C8-DO commented 6 years ago

In one of my longer documents I'm using all six levels of headers (h1-h6) and the TOC becomes really huge. It would be nice to be able to specify which header levels to include in the TOC. For example:

[TOC 3]

would only include h1-h3.

And because I normally use h1 and h2 as sort of a title for my documents and don't use them anywhere else, it would be even nicer if I could also specify a start level, so

[TOC 3-4]

would only include the header levels h3 and h4 in the TOC.

uranusjr commented 6 years ago

Nice idea. I should look into this.

C8-DO commented 6 years ago

Since my post I found out that hoedown already has this option – at least for the level 1-n form. With hoedown --html-toc --toc-level nonly the first n levels are included in the toc. So maybe this will be easy for you to implement?

The second form I suggested would certainly be the cherry on top ;-)