I feel like a complete idiot, but I simply can't figure out how does chapter-detection and toc-generation work. I am still using the HTML code described earlier:
Code:
<h2 id="chapter-10">The Attack</h2>
<p>Something attacked you. You are dead.</p>
I tried many different combinations of --chapter-regex, --chapter-attr, --add-chapters-to-toc, but no go - I never get a TOC. Unfortunately, the documentation is rather sparse on chapter detection. I took it to mean:
1) --add-chapters-to-toc is required if I want the TOC.
2) --chapter-regex=. should, as I understand it, match any h1-h6 tag whose content ("The Attack", in my case) is at least one character long.
3) --chapter-attr=h2,id,chapter should match any <h2 id="chapteranything">
But it does not. If I use all three or just 1 and 2 or 1 and 3, I always get the same result: no TOC items at all.