Closed
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Problem
I am trying to create a table of contents for h2s and h3s only. There is a maxDepth
option which enables me to ignore h4-h6 headings, but not a minDepth
option to ignore h1s.
In my document, the single h1 is the main title of the document, with subheadings in the h2-h6 range.
It makes sense to me that the table of contents not contain the h1.
Solution
Add a minDepth
option.
Alternatives
I could remove the h1 from the mdast
tree before passing it to toc(mdast)
.