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

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 11-18-2012, 04:34 AM   #1
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 5,462
Karma: 5446712
Join Date: Jul 2011
Location: Australia
Device: Kobo Touch, Kobo Glo
Getting the TOC from an ePub

For something I am trying with the Kobo driver, I need to retrieve the TOC from ePubs. I first look at this earlier in the year and have implemented something using calibre.ebooks.oeb.iterator. It works, but I am wondering if there is another way.

What I need is the TOC entry with the title and the path for the link. Is there a best way to get this?
davidfor is offline   Reply With Quote
Old 11-18-2012, 11:13 AM   #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,931
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look at metadata/epub.py that will show you how to get the parsed OPF from an epub easily. IIRC the opf object has a .toc attribute you can use to access the toc.
kovidgoyal 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
Help with ePub 3 TOC mynock70 ePub 4 11-20-2012 03:14 PM
Multi-level TOC broken in epub->epub conversion siebert Conversion 14 03-09-2011 05:38 PM
ePub TOC to mobi TOC edmnddntes Conversion 5 01-24-2011 02:56 AM
Epub to Epub loses TOC edbro Calibre 6 10-12-2010 04:24 PM
epub TOC crutledge ePub 2 02-14-2010 04:57 PM


All times are GMT -4. The time now is 08:48 PM.


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