Create a template with only the ToC generating stuff:

``````html
<nav id="$idprefix$TOC" role="doc-toc">
$if(toc-title)$
<h2 id="$idprefix$toc-title">$toc-title$</h2>
$endif$
$table-of-contents$
</nav>
``````

or just the last line but one if you don't want the nav element and title. Save that to something like `gen-toc.html` and invoke pandoc with `--template=gen-toc.html` added. You might want to place the template in the templates subdirectory of your pandoc user directory (both of which you may have to create; see `pandoc --help` for where) so that you can use it from anywhere.




Den tors 17 nov. 2022 17:49Craig Parker <craig.fossfolks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
Is there a way to generate JUST a table of contents? I can probably hack up a file with bash after the fact, but didn't know if there was a way to redirect TOC content to another html file.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/14f84699-724f-4483-8fe6-1845d1fe81b5n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhA2MfhXh%2B4hiE7H1DtWyupDXVqx5KC-qCLiS2G%2BUoSx1g%40mail.gmail.com.