Thread: LRF output
View Single Post
Old 08-28-2008, 09:11 AM   #739
pepak
Guru
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
Posts: 610
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-T3, Kobo Libra H2O
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.
pepak is offline   Reply With Quote