markdown-notes icon indicating copy to clipboard operation
markdown-notes copied to clipboard

Automatically create a TOC for sections and subsections

Open fvisin opened this issue 10 years ago • 2 comments

It would be nice to be able to hide/show a table of content on the left of the page, at least in the Preview only mode.

Ideally, the TOC should be automatically generated from the sections and the subsections. Also, the depth of the TOC should be configurable (e.g. sections only, sections+subsctions, sections + sub + sub-subsections, ...) and/or it should be possible to tag the (sub)sections that should appear in the TOC.

fvisin avatar Sep 11 '15 04:09 fvisin

I agree. However, since the preview needs to be regenerated every time there is a change in the original document, any post-processing adds significant delay to the rendering.

I need to clear things like #4 before it's even possible, so I'm adding it to the "far future" milestone.

nicbou avatar Sep 11 '15 08:09 nicbou

[ Thank you for your fast reply and for the amazing tool, BTW! ]

What if it is limited to the Preview only mode? In that case it would have to be generated only when the Preview button is clicked (i.e., not everytime new scripting code is added). It could be done by replacing the Editor with the TOC when Preview is clicked. I didn't dig into the code so I might be wrong, but from the outside seems like a reasonable solution.

fvisin avatar Sep 11 '15 18:09 fvisin