View Single Post
Old 03-24-2012, 02:42 PM   #10
Jabby
Jr. - Junior Member
Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.Jabby ought to be getting tired of karma fortunes by now.
 
Posts: 586
Karma: 2000358
Join Date: Aug 2010
Location: Alabama
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
Quote:
Originally Posted by theducks View Post
Seeing the Images have unrecognisable generic names
Make them meaningful (eg. ..\Images\chapter_1), hopefully using the great Bulk renamer Meme built.
(Sigil adjusts the references )

Now that is done,
REGEX time

Code fragments

your search term: will include:
<h1 class="calibre8" id="calibre_pb_(\d+)">
Images\\chapter (\d+) <- note the SECOND forward reference

You are going to replace

<h1 class="calibre8" title="Chapter \2" > The Bold is what will be in the TOC

and repair the captured text

Images\chapter \2

I just threw away the id tag as Sigil's TOC generator will make a new one if missing
If you have books that come from Calibre and your book has other images scattered around, you could have a problem.

Calibre assigns a starting image number and increments as it goes. So,you could have a chapter 5 (00005.jpg) image followed by a photo image (00006.jpg) followed by a chapter 6 (00007.jpg) image. This sequence would put a photo to depict chapter 6 and all after would be off.

This works just fine if the chapters are in strict sequential order. You needn't ask how I know.

Regards - John

Last edited by Jabby; 03-24-2012 at 05:06 PM.
Jabby is offline   Reply With Quote