Microflash / rehype-toc

Rehype plugin to generate a table of contents (TOC)
MIT License
3 stars 0 forks source link

Could the TOC not be made hierarchical? #1

Open mmoser18 opened 1 month ago

mmoser18 commented 1 month ago

I was seeking a version of the toc plugin that does not place the generated table of content at the begin of the resulting document but at a choosable position. I thus very much liked the feature that I can put a placeholder [[toc]] into my markdown file at a position of my liking and that this plugin then inserts the TOC there. But why - for Christ's sake - it the TOC only a linear, non-hierarchical list and not a decent "normal" structured, hierarchical table of content (like the default rehype-toc produces)? Such a simplistic linear list makes this plugin useless for me. What a pity...

naiyerasif commented 1 month ago

There's nothing stopping you to generate a hierarchical list. You can pass toc(headings) function in the options and generate the TOC howsoever you want.