01-03-2009, 01:41 PM | #1 |
book creator
Posts: 9,656
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: Kindle Scribe
|
Xpath hierarchical structure
Okay, I need help on this one. I am making this ePUB book with 4 hierarchical levels: Main Book, books, parts, chapters. I can do hierarchical TOCS (in ePUB) via the GUI, but that goes only two levels deep. How do I separate hierarchical levels now in the command line (//H1 //H2 //H3 //H4 enumerates them all but on the same hierarchical level). Please help as I do not find this info in Kovids Xpath help page.
|
01-03-2009, 01:58 PM | #2 |
creator of calibre
Posts: 44,356
Karma: 23708270
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can't in an automated way. You'd have to unzip the epub file and edit the ncx file within it by hand. Alternatively (though I haven't tried this to see how well it works) You can create hierarchical HTML table of contents.
So toc1.html - list of books linksto toc2.html in each book In each book, toc2.html - list of parts links to toc3.html in each part and so on then run any2epub on toc1.html with the options --max-toc-links=1000 --no-chapters-in-toc This will likely have all the links in your TOC files, but there will be some extra links. Just unzip the epub file (or use --extract-to) and edit the NCX file, simple deleting unwanted links. |
Advert | |
|
01-03-2009, 02:14 PM | #3 | |
book creator
Posts: 9,656
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: Kindle Scribe
|
Quote:
Wouldn't the easiest way be to make the third and fourth level flat and then edit the NCX file by hand like you suggested? Good idea btw. |
|
01-03-2009, 02:23 PM | #4 |
creator of calibre
Posts: 44,356
Karma: 23708270
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
01-03-2009, 02:40 PM | #5 |
book creator
Posts: 9,656
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: Kindle Scribe
|
Her is a sample of simple hierarchical structure, btw. I would like to know how that works in a Sony Reader https://www.mobileread.com/forums/sho...d.php?p=319150 Could someone with a Sony please tell me?
|
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need help with XPath | NASCARaddicted | ePub | 13 | 02-20-2015 06:04 AM |
XPath Expression wizard?? | tonyx3 | Calibre | 1 | 01-26-2010 04:49 AM |
XPath question | krischik | Calibre | 0 | 01-16-2010 08:22 AM |
XPath Help and Pagebreak | emellaich | Calibre | 3 | 07-28-2009 02:17 PM |
XPath query | amjbrown | Calibre | 2 | 05-10-2009 06:04 PM |