Codimd: table of contents tag only displays 3 levels of headline

Created on 22 Feb 2017  路  6Comments  路  Source: hackmdio/codimd

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.

Hacktoberfest enhancement feature

Most helpful comment

@milkmiruku currently, we don't have an option for customizing TOC ranges.
But maybe this would be nice to have.

All 6 comments

Thanks @milkmiruku
Maybe we can add option to TOC tag,
like [TOC level=4] to set TOC level ?

@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.
But maybe this would be nice to have.

I found a good example for the YAML metadata options.

https://shd101wyy.github.io/markdown-preview-enhanced/#/toc?id=toc-and-sidebar-toc-configuration

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 --toc and --toc-depth). 馃檭

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mxmilkiib picture mxmilkiib  路  3Comments

qiuwch picture qiuwch  路  3Comments

SISheogorath picture SISheogorath  路  4Comments

ccoenen picture ccoenen  路  4Comments

LukasKalbertodt picture LukasKalbertodt  路  4Comments