Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-02-2012, 10:39 PM   #1
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
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">&nbsp;</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
phossler is offline   Reply With Quote
Old 09-02-2012, 11:12 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by phossler View Post
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">&nbsp;</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
If you simply remove the class selectors from the stylesheet, they will be ignored in the body.
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
theducks is offline   Reply With Quote
Advert
Old 09-03-2012, 04:09 PM   #3
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
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
phossler is offline   Reply With Quote
Old 09-03-2012, 04:28 PM   #4
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,724
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by phossler View Post
So I was looking for some technique or RegEx guidence to make it a little easier
If you're 100% sure that you won't be needing any of the Calibre styles, simply use the following regex:

Find: class="calibre\d+"
Replace:

(There's a space before "class" in the Find expression.)
Doitsu is offline   Reply With Quote
Old 09-03-2012, 08:17 PM   #5
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
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
phossler is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 05:58 AM.


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