![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Little F&R RegEx help to clean a Calibre conversion
Real noob question:
When I convert a MOBI to EPUB using Calibre to clean it up and add my own CSS using Sigil, there's a lot of Calibre-created tags that I have to manually do a F&R on. Things like: <p class="calibre2"> ... <p class="calibre99"> etc. <p class="calibre1 sgc-1"> </p> <div class="mbppagebreak" id="calibre_pb_0"></div> My CSS has the 'standard' <p>, <h1>, etc. and I usually have to tidy' up the Calibre tags, inport my CSS, and manually apply the Headings I assume there's no script (darn !!!) , but some guidence on a easy way to clean the tags would be appreciated. Paul |
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,001
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Now, doing it your way, destroys existing styling that is only slightly obvious from context. How does your P tag know an item should be centered? Italic? Bold? What about the H tag? Centered? Italic? ![]() Then ther is the infamous HR tag that ADE does not center if less than full width. ![]() IMHO it is far better to hand tune each stylesheet that FITS THE BOOK than use a OSFA stylesheet with a book NOT created for that sheet |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Thanks for the insights, and they're pretty much right on.
The input to the conversion that uses such radical surgery are usually garbaged up, having 2 or 3 TOC's embedded, bad chapter breaks, inconsistant fonts, etc. The original format is long gone. I typically just want to clean them up for be readable on my Kindle, and have a usable TOC. Doing the cleaning in Sigil, manually spliting and marking the chapters, and using Calibre to convert the EPUB to MOBI works well enough to have a readable book for personal use. My CSS with my <p> and <hx> includes the .italic, .bold, .underline that Calibre likes to add, as well a serif font (personal preference) I just try to tidy things up by deleteing the Calibre added classes, etc. and doing the F&R manually the way I only know how to do it is tedious and error prone. So I was looking for some technique or RegEx guidence to make it a little easier Paul |
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,724
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Find: class="calibre\d+" Replace: (There's a space before "class" in the Find expression.) |
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Thanks, and I WILL make a back up ... just in case
Paul |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
clean HTML or PDF before mobi conversion in Calibre | mark235 | Calibre | 9 | 12-25-2010 09:37 PM |
BookDesigner HTML0 to clean HTML conversion utility | Pablo | Workshop | 15 | 08-24-2010 12:05 PM |
Conversion and Regex Help | thedevilsjester | Calibre | 0 | 07-16-2010 06:10 PM |
Calibre & E505 best conversion recipes? | Locheil | Calibre | 8 | 06-12-2009 09:53 AM |
Tool to easily clean and refurbish html-text before conversion | Pulp | Workshop | 3 | 10-13-2008 10:16 AM |