Auto-generate table of contents
jeremyburton last edited by
Has anyone already created a workflow to auto-generate a hyperlinked table of contents in Editorial? My searches haven't unearthed anything. I'd like to be able to add a TOC to the top of longer Markdown docs. If no one has already done this, does anyone have any suggestions for how to go about this?
Loveless212 last edited by
I have something similar to what you are asking about, mine though takes titles > creates file > than links it.
lrr last edited by
You can put [TOC] at the top of your document, and use a few lines of Python instead of Editorial's renderer. The included markdown module has a toc extension.
Or you could write a script to put an anchor tag next to each of your headings, and prepend a Markdown list to your document. This is worse in every way, but allows you to edit the TOC independent of the headings.
omz last edited by
I've made a little demo workflow using @lrr's approach:
If you use the dark theme, you might want to adjust the CSS colors in the Show HTML action.