04-25-2012, 06:38 AM | #1 |
Member
Posts: 12
Karma: 10
Join Date: Jun 2011
Device: Android
|
Can't get --level2-toc to work
I'm trying to convert an HTML file to epub and while the level 1 contents is working I can't make the level 2 contents work. A typical exerpt from my document is:
Code:
<h1 class="chapter">ALTERNATE TECHNOLOGY</h1> <h1></h1><h3 class="subheading">Split Infinities</h3> <p>Welcome to your new ARNS Home Universe GeneratorTM 3.6.4! Those ...p> Code:
ebook-convert "Ira Nayman - Luna for the Lunies.html" .epub --authors "Ira Nayman" --title "Luna for the Lunies" --cover "Ira Nayman - Luna for the Lunies.jpg" --level1-toc //h:h1[@class="chapter"] --level2-toc //h:h3 --input-encoding cp1252 Calibre correctly detects and builds all the level 1 contents, but I get no level 2 contents. If anyone can spot my deliberate mistake I'll be eternally grateful! |
04-25-2012, 12:31 PM | #2 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
I don't use the commandline interface myself, but does it help if you add a --chapter option? e.g. something like
--chapter //*[name()='h1' or name()='h3'] |
04-26-2012, 01:45 AM | #3 |
Member
Posts: 12
Karma: 10
Join Date: Jun 2011
Device: Android
|
Thanks, I'll give this a try just to see what happens, but I have <h1> tags that I don't want included in the TOC.
|
04-26-2012, 02:02 AM | #4 | |
Member
Posts: 12
Karma: 10
Join Date: Jun 2011
Device: Android
|
Quote:
Code:
--chapter //*[@class='subheading' or @class='subheading'] |
|
04-26-2012, 06:29 AM | #5 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
My Xpath knowledge is poor but can you find a way to construct an expression which combines your level1 toc Xpath and level2 toc Xpath in an either/or Xpath expression and put it in the --chapter setting.
Alternatively, you could cheat! Create the epub with all the correct TOC entries at a single level, then edit the .ncx file (either manually or using a utility like Nigol's epubfixer utility) to nest the entries correctly and/or remove any unwanted entries. |
Tags |
contents |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ToC doesn't work on my Kindle | BeccaPrice | Conversion | 4 | 10-31-2011 10:33 PM |
it work's, but the toc isn't right | schuster | Recipes | 12 | 06-10-2011 03:16 PM |
How does the TOC editor work? | Kivgaen | Sigil | 31 | 06-25-2010 10:28 AM |
HELP, how do i make the TOC work in Ebook Publisher. | Lago | Fictionwise eBookwise | 7 | 03-07-2010 08:08 PM |
Getting TOC to work? | enarchay | Sony Reader | 11 | 05-28-2009 05:46 AM |