Mobileread
[GUI Plugin] Modify ePub
#1  kiwidude 10-22-2011, 11:27 AM
This plugin offers a way to perform certain modifications to your selected ePub files without performing a calibre conversion. This plugin was created a number of months ago and has a history documented in the Development forum on this thread.

Performing an ePub->ePub conversion will enforce a number of changes to your ePub, some of which can be undesirable for some users. Examples are the rewriting of CSS, margin modifications, file splitting in undesired places, changes to directory structure etc.

Instead this plugin allows a user specific subset of changes to be performed in isolation without otherwise touching the original ePub's file structure, CSS files etc. Frequently these changes have been performed manually by users either using the Tweak ePub feature (time consuming), by editing in Sigil (which introduces changes/side effects of its own), by doing ePub->ePub conversions, or by saving to disk and reimporting into calibre.

Users may also find it useful to install the Quality Check plugin, which offers the ability to identify ePubs in your library which qualify for many of the modifications this plugin can make.

Refer to the Help file accessed from the plugin dialog or below for full details on each of the modification options and when you might use them.

Main Features:
Special Notes:
Paypal Donations:
[zip] Modify ePub.zip (259.9 KB, 2437 views)
Reply 

#2  DoctorOhh 10-22-2011, 08:45 PM
Excellent, it will now be easier to refer folks to this plugin.
Reply 

#3  bizzybody 10-23-2011, 01:22 AM
Here's a feature request, a function to edit or remove text color settings in the stylesheet.css file. I spent a lot of time trying different converters from epub to Mobi but none of them would get rid of what had the text locked to black (actually a really really dark grey). Finally, in response to a post in the epub forum, I was pointed to Sigil and looking for references to color in stylesheet.css. I found three instances of color: #231F20; deleted them and saved. Then the book converted without the text color locked.

I figure the best setup would be to find each color setting and show an example of what changing or removing each setting will do. Might not want to remove *all* the color settings, in this book the TOC links and chapter headings are set to "blue" while the rest of the text was 231F20. I left the "blue" and removed the others.

Boggles me why anyone would set a color to look like printed "black" ink when black text is the default on readers and reader software.

I read on my LED screen phone in white on black because it improves the battery life a bunch VS black on white. Black pixels on LED screens use zero power, VS white pixels on LCD using zero power, other than the backlight shining through. No backlight on LED.
Reply 

#4  DoctorOhh 10-23-2011, 01:54 AM
Kiwidude, let me state it a little simpler. It would be nice if you could add the option to remove text color and remove background color to the plugin.
Reply 

#5  kiwidude 10-25-2011, 07:51 PM
@bizzybody/dwanthny - modifying the css via this plugin is one of those things I personally have avoided to date, though I guess Idolse must be doing with his additions to this plugin. It has to be done in a bulletproof way while minimising the changes to the css, which means not using third party css parsing code for instance. It should be possible using regular expressions but needs careful application and a lot of testing. I want people to have confidence that when they use this plugin it lives up to its billing of making the least changes possible to do their task, instead of the potential gotchas associated with alternatives.

You have to handle potentially mutiple css files, and also inline css as well...

If I do take the leap at some point, certainly stripping colors could be an option to support. I would add to that wish list things options like line-height, letter-spacing and font-family too, no doubt there are others I've forgotten.
Reply 

#6  ldolse 10-25-2011, 10:45 PM
Quote kiwidude
@bizzybody/dwanthny - modifying the css via this plugin is one of those things I personally have avoided to date, though I guess Idolse must be doing with his additions to this plugin. It has to be done in a bulletproof way while minimising the changes to the css, which means not using third party css parsing code for instance.

You have to handle potentially mutiple css files, and also inline css as well...
I haven't taken the leap and done my whole library with the plugin yet, but I've modified dozens if not a couple hundred ePub's css using this plugin. The code works in all the ways you describe at this point - multiple css files are supported, inline styles in the html, etc. It would be trivial to modify other css styles - the other thing it seems people want is to automatically add/remove justification.

I think the trick would be to apply all the css modifications at once though, so it would require a bit of a re-design of the current function - basically a top level modify css, then a bunch of sub-functions - sort of like heuristics.
Reply 

#7  Magnus 10-26-2011, 11:15 PM
I'm quite naive here... but I noticed that when I run the plugin I get:

Looking for non dc: elements in manifest
Removing child: {http://www.idpf.org/2007/opf}meta


After I've modified the ePub, the result persists when I again run the plugin. Why is that? What have I overlooked?
Reply 

#8  kiwidude 10-27-2011, 04:58 AM
@Magnus - what "result persists"are you referring to? Send me a PM with a link to the ePub and more detail on what it is doing the you don't expect it to.
Reply 

#9  capnm 11-02-2011, 10:37 AM
Glad to see this made it to prime time! Thanks guys!

I looked at the issue of line spacing a while ago and discovered that a popular technique for setting line spacing is to manipulate the font size (set the paragraph class to, say, font-size 1.3em, line-spacing 1, then span all the text blocks with a font-size .75 em ) making it really hard to 'fix'.
Reply 

#10  paulfiera 11-05-2011, 01:29 PM
It'd be really great to have the possibility of updating the jacket with all the metadata, including tags.

Sometimes I change the tags and I would like to update the whole epub jacket without doing a conversion.
Reply 

  Next »  Last »  (1/173)
Today's Posts | Search this Thread | Login | Register