Honestly I haven't tried yet. Maybe Asciidoctor (Which I used) has it figured out. It would at least need to have good enough output for the code examples, otherwise it would probably be a non-starter.

I added links to example pages (which include TOC) to the Gumroad page and here, but yeah I should have put it on the homepage.