You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I only need headers of levels 1 or 2 to be shown in TOC (as TOC would be too long if I have many subsections), but it seems that by default levels 1-4 would all show up. Is there an option to remove headers with levels >2 from TOC? Thanks.
EDIT: moreover, if I use the theme "readthedocs", all headers seems to be "of the same level" in the TOC.
Why was this closed? I think this is a very important thing, specially for large docs, I do not want all h3 and h4's to be listed in the TOC (using RTD theme, where this has really a annoying impact, since it makes the sidebar super long)
I can't read @tomchristie's mind, but I know I'm not interested in developing a complex theme with many config settings that meets every conceivable need. Users can create their own custom themes (there is already a few third party themes which address some of these needs), and/or override bits and pieces of the existing themes to create whatever custom functionality they want/need. There is not any additional action we need to take to make that possible for users so there is no need to leave this issue open.
IMHO toc depth is not really 'every conceivable need' at least for a documentation system, but I can understand opinions diverge. On the other hand, the fact that in the 'readthedocs' theme all headers seem to be 'of the same level' in the TOC (as reported by the OP) is not a feature request, rather a bug.
I'm not really spending time on MkDocs lately myself, so <shrug>.
I assume this only applies to the RTD theme right? The mkdocs theme only displays 2 levels.
am i wrong or could this rather simply be solved by restricting the items by their depth when the context is populated? rather than tinkering on the template level.
@funkyfuture the TOC is obtained from the TOC extension to the Markdown parser. Therefore, the entire TOC is already created before MkDocs ever sees it. Whether it is then restricted when the context is created or in the template is simply an implementation detail.
Activity
lovelydinosaur commentedon Dec 8, 2014
No there's not currently any option to allow that.
For now you'd need to use a custom theme if the existing ones don't meet your needs.
ePirat commentedon Jan 4, 2015
Why was this closed? I think this is a very important thing, specially for large docs, I do not want all h3 and h4's to be listed in the TOC (using RTD theme, where this has really a annoying impact, since it makes the sidebar super long)
tverbeke commentedon Dec 18, 2016
@tomchristie The issue is still present in version 0.16.0 - I agree with @ePirat that it may be better to reopen for the same reasons.
waylan commentedon Dec 18, 2016
I can't read @tomchristie's mind, but I know I'm not interested in developing a complex theme with many config settings that meets every conceivable need. Users can create their own custom themes (there is already a few third party themes which address some of these needs), and/or override bits and pieces of the existing themes to create whatever custom functionality they want/need. There is not any additional action we need to take to make that possible for users so there is no need to leave this issue open.
tverbeke commentedon Dec 18, 2016
IMHO toc depth is not really 'every conceivable need' at least for a documentation system, but I can understand opinions diverge. On the other hand, the fact that in the 'readthedocs' theme all headers seem to be 'of the same level' in the TOC (as reported by the OP) is not a feature request, rather a bug.
waylan commentedon Dec 18, 2016
The issues with the
readthedocstheme are covered by #588. You should follow up there if the specific issue you are having is not already mentioned.lovelydinosaur commentedon Dec 19, 2016
I'm not really spending time on MkDocs lately myself, so <shrug>.
I assume this only applies to the RTD theme right? The
mkdocstheme only displays 2 levels.funkyfuture commentedon May 4, 2017
am i wrong or could this rather simply be solved by restricting the items by their depth when the context is populated? rather than tinkering on the template level.
waylan commentedon May 4, 2017
@funkyfuture the TOC is obtained from the TOC extension to the Markdown parser. Therefore, the entire TOC is already created before MkDocs ever sees it. Whether it is then restricted when the context is created or in the template is simply an implementation detail.