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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-03-2012, 07:53 AM   #1
Bad Astronaut
Member
Bad Astronaut began at the beginning.
 
Posts: 20
Karma: 30
Join Date: Sep 2010
Device: Kindle 3
Generating TOC Section Names

I have an epub with section tags as follows:

Code:
<p class="calibre1"><a id="bookmark6" class="calibre2"></a>Introduction</p>
Other sections have random text names. I can recognize the sections using the expression
Code:
//*[re:test(@id, "bookmark.*", "i")]
However the sections are all called "Unnamed". I can see why, the text I'm after (eg. Introduction) is in a different tag than the one I'm searching for. Is there a way to get calibre to pick up the section names in this case?
Bad Astronaut is offline   Reply With Quote
Old 05-03-2012, 08:08 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: 26,309
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Match the parent of that tag, something like

//*[re:test(@id, "bookmark.*", "i")]/..
kovidgoyal is online now   Reply With Quote
Old 05-03-2012, 03:45 PM   #3
Bad Astronaut
Member
Bad Astronaut began at the beginning.
 
Posts: 20
Karma: 30
Join Date: Sep 2010
Device: Kindle 3
Thanks Kovid, that did the trick!

Some day I'll actually learn regex...
Bad Astronaut 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 generating TOC Diabolikul Conversion 3 01-26-2012 11:42 AM
New Calibre isn't generating TOC ccraig13 Conversion 2 10-07-2011 10:58 AM
TOC - Kindle - Not Generating superted Conversion 2 05-15-2011 08:28 AM
Trouble generating a TOC foghat Calibre 2 05-07-2010 07:00 PM
Problem generating TOC ronin712 Calibre 9 07-21-2009 06:19 PM


All times are GMT -4. The time now is 06:50 AM.


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