Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-03-2009, 01:41 PM   #1
mtravellerh
book creator
mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.
 
mtravellerh's Avatar
 
Posts: 9,613
Karma: 1620342
Join Date: Oct 2008
Location: Luxembourg
Device: PB360°
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.
mtravellerh is offline   Reply With Quote
Old 01-03-2009, 01:58 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,820
Karma: 5006091
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.
kovidgoyal is offline   Reply With Quote
 
Enthusiast
Old 01-03-2009, 02:14 PM   #3
mtravellerh
book creator
mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.
 
mtravellerh's Avatar
 
Posts: 9,613
Karma: 1620342
Join Date: Oct 2008
Location: Luxembourg
Device: PB360°
Quote:
Originally Posted by kovidgoyal View Post
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.
Thanks

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.
mtravellerh is offline   Reply With Quote
Old 01-03-2009, 02:23 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,820
Karma: 5006091
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by mtravellerh View Post
Thanks

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.
Sure, depends on what kind of editing you find easier. Try it and see.
kovidgoyal is offline   Reply With Quote
Old 01-03-2009, 02:40 PM   #5
mtravellerh
book creator
mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.
 
mtravellerh's Avatar
 
Posts: 9,613
Karma: 1620342
Join Date: Oct 2008
Location: Luxembourg
Device: PB360°
Her is a sample of simple hierarchical structure, btw. I would like to know how that works in a Sony Reader http://www.mobileread.com/forums/sho...d.php?p=319150 Could someone with a Sony please tell me?
mtravellerh is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with XPath NASCARaddicted ePub 12 04-25-2010 05:20 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


All times are GMT -4. The time now is 01:34 PM.


MobileRead.com is a privately owned, operated and funded community.