|04-19-2011, 04:06 PM||#1|
Join Date: Apr 2011
retagging chapter heads?
EDIT - solved this myself, second post in case someone needs it
I've spent the past 72 hours playing with Indesign, Sigil, and Calibre, trying to get my print books to a valid epub format with varying degrees of success.
I've run into a couple walls, the first of which is identifying chapters.
After exporting to Epub from Indesign (slightly simplified / rearranged from original print version), if I open the epub in Sigil I have one huge file and the chapter heads look like:
<p class="chapter-head"><span class="generated-style">This is a Chapter Name</span></p>
<hr class="sigilChapterBreak" /> <h2>This is a Chapter Name</hr>
Now, my problem is that while it's easy enough to search and replace the first half of that markup, the second half
Is there any way to do a Regular Expression search/replace that will take the above markup, with some sort of wildcard for the chaptername, that will return the new markup with the original Chaptername? I figured out how to do this in GREP once for something else, but I'm currently just lost. Then, I can just run this search replace on all of my books, and it would be of massive help to me.
If someone has a completely alternate suggestion, I'm all ears as well, but this seems to be the quickest and makes the most sense. I'd even be ok with doing the search and replace using some other tool if necessary (unzipping the epub) but was hoping I could do it inside of Sigil for obvious reasons.
Last edited by affa; 04-19-2011 at 04:40 PM.
|04-19-2011, 04:55 PM||#3|
Join Date: Sep 2010
Device: Sony PRS 650
Here it is for ANY class and ANY span:
Find: <p[^>]*><span[^>]*>((Chapt|CHAPT)[^</]*)</span></p> Replace: <hr class="sigilChapterBreak" /><h2>\1</h2>
|Thread Tools||Search this Thread|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Ebook chapter titles: with or without chapter number?||amoroso||Writers' Corner||16||06-14-2011 07:35 AM|
|Next Chapter skips to End in last chapter?||JoGoCo||Kobo Reader||5||07-13-2010 10:23 PM|
|K2 v K1: Chapter-to-chapter missing from some books?||Starhawk||Amazon Kindle||4||03-10-2009 07:27 PM|
|Retagging PDF files for mobile devices||RKramkowski||0||07-18-2006 11:31 AM|