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

[feature request] ignore H1 tag if there is only one, and it is a the top of the page.

Open torsday opened this issue 9 years ago • 3 comments

torsday avatar Jan 29 '16 17:01 torsday

I think that is the purpose of depthFrom:1. Try to set it to 2 and refresh your TOC (CTRL + ALT + U)?

nicofrand avatar Feb 01 '16 14:02 nicofrand

@nicofrand depthFrom option will just omit all the titles from a certain level.

Here a usecase: you get a # title at the beginning of your file, and you want your TOC below it, you probably don't want this first titles in your TOC. Therfore, you might want a startFrom:2 option to be able to exclude 1 or more title from the TOC, starting from the beginning of the file.

ponsfrilus avatar Apr 12 '19 22:04 ponsfrilus

There is a workaround: use ===== or ----- for h1 or h2 titles, they will not be included in the TOC. (See https://github.com/nok/markdown-toc/issues/62#issuecomment-182293322)

ponsfrilus avatar Apr 12 '19 23:04 ponsfrilus