TOC generation heading level (lower and) upper limit
Which part of the project should be enhanced?
TOC Generation
Is your enhancement request related to a problem? Please describe.
In some documents, we have a multitude of sub-headings, each of which has the same 3 sub-sub-headings. in the TOC, we would like to see all sub-headings, but not their repetitive sub-sub-headings.
Example:
# Header
## Topic 1
### A
### B
### C
## Topic 2
### A
### B
### C
## Topic 3
### A
### B
### C
Describe the solution you'd like
either allow setting an upper (and maybe also lower) limit either:
- Through one field each in the FrontMatter,
- or in the TOC tag its self:
[TOC:1:3].
I would prefer 1., but 2. would allow different settings in case of multiple TOCs (which I am not interested in).
Describe alternatives you've considered
Using the TOC as it works now, or manually creating and updating it.
Additional context
No response
We don't generate the TOC ourself. We use https://github.com/nagaozen/markdown-it-toc-done-right for that. So if you want that feature you should open an issue there.
thanks @mrdrogdrog ! :-)
I read in their README (and several issues), that they already support it with the level setting, as explained in the Options section in their README. I tried setting it in my front-matter, but there was no change in the generated TOC:
level: 1
I guess, I'd need to set it .. in some namespace? or is it only possible to set in code (as in, a fork of hedgedoc)?
There is no frontmatter option for that in hedgedoc yet. We can add it, but it will take some time and it won't come to HedgeDoc 1. As you can read in the README of the hedgedoc repo, we don't add new features to HedgeDoc 1 because we focus on the development of HedgeDoc 2.
ook, thank you! :-) I guess then.. this can be closed, right?
Well. This repository contains the in-development frontend of HedgeDoc 2. So if you want this feature and can wait a bit, we can add it to HedgeDoc 2 :yum:
ahhh.... ok, perfect! :-) and yes of course, it would be nice to have in the future. not for exactly this Pad I am working on, but this is a reoccurring theme.
Through one field each in the FrontMatter,
We can do that and probably will.
or in the TOC tag its self: [TOC:1:3].
The parsing of the [TOC] tag is done by the linked markdown-it plugin. If you want that then open an issue in their repository.