DEV Community

loading...

Pandoc TOC without standalone mode

Lance Bachmeier
I'm a macroeconomist, energy economist, and time series econometrician that does a lot of programming
・1 min read

This is a specialized post that very few people will find useful. But since it's not something you can easily find by searching, I'll make it available to anyone else in my position.

I wanted to add a table of contents to a document in Pandoc, but without standalone mode - something that is not possible. However, you can just use a very minimalist template called something like blank.html:

$toc$
$body$

That's it. Then this

pandoc -s file.md -o file.html --template=blank.html

is just as good as not using standalone mode.

Discussion (0)