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
Would be great to have [TOC] support to automatically list out the contents of the different headers. Probably would be a good candidate for another extension
Activity
GregJohnStewart commentedon Oct 15, 2020
Sorry, meant to make this a feature request, not a bug
robinst commentedon Oct 16, 2020
Hey! Yeah sounds like a useful extension. Looks like there's a couple of existing syntaxes, from here: https://alexharv074.github.io/2018/08/28/auto-generating-markdown-tables-of-contents.html
{:toc}[[_TOC_]][toc]And this one doesn't seem to need any syntax, so I assume if the extension is used it is inserted at the top of the document: https://commonmark.thephpleague.com/1.5/extensions/table-of-contents/
Any thoughts about what we should do? Some more research into prior art would be good.
robinst commentedon Oct 16, 2020
Also, it would probably need to be paired with the heading anchor extension (https://github.com/atlassian/commonmark-java#heading-anchor) to be able to link to headers.
colinodell commentedon Jun 26, 2021
We support three options:
[TOC]) is found; this placeholder syntax is customizableia3andy commentedon Jan 23, 2026
You could also generate it in the browser like here (and get scroll sync in bonus):
https://ia3andy.github.io/the-code-site/posts/discover-roq-the-quarkus-way-for-static-site-generation-in-java/
Here is the script:
https://github.com/ia3andy/the-code-site/blob/main/web/toc.js