-
Notifications
You must be signed in to change notification settings - Fork 1.1k
table of contents tag only displays 3 levels of headline #368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks @milkmiruku |
@milkmiruku if you only need the title for list/overview, you could also add it to the yaml metadata at the top like this ---
title: This is my awesome document. There are many like it, but this one is mine!
--- see https://hackmd.io/yaml-metadata for more detailed info. |
@ccoenen thanks, it's more I'd like to use h1 for the document name/title. An alternative idea could be an option to shunt the TOC so it ignores h1 (if there is only one)? |
@milkmiruku currently, we don't have an option for customizing TOC ranges. |
I found a good example for the YAML metadata options. https://shd101wyy.github.io/markdown-preview-enhanced/#/toc?id=toc-and-sidebar-toc-configuration |
An option to set the ToC depth would be really helpful! Maybe you'd like to just use the same syntax as R Markdown does? It looks like this: ---
title: "Habits"
output:
html_document:
toc: true
toc_depth: 2
--- Then we could set the ToC separately for each export format. Of course that would imply some additional implementation work, but since both HackMD/CodiMD and R Markdown/Knitr are relying on Pandoc to convert the Markdown, that would really make sense I guess (the above YAML keys correspond to Pandoc's CLI options |
We supported to change this by #1532 |
While I can see benefits for this in some situations, I have the first H1 as the document title so my 'third level' document body is ####, it would be handy if headers of level 4 (and possibly 5) could be displayed via [TOC] or maybe a new tag.
The text was updated successfully, but these errors were encountered: