|
|
#1 |
|
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Dec 2009
Device: Cool-ER
|
EPUB (CSS) tweaker app
A week or so I posted about how frustrating it was that, when using Calibre to convert from LIT format, you have no control about the justification of your final EPUB - depending on the LIT it'll either be left justified or fully justified, but you get no ability to choose your preferred option. The sound of tumbleweeds drifting by was deafening (translation: no-one appeared to care based on the lack of responses I got to my post). In the end I threw together the attached Java app and am posting here in case others also find it useful. Basically, it'll open up an EPUB and let you edit the CSS directly, then let you save the changes, saving you the aggro of extracting the EPUB and repacking it afterwards. In the simple editor the more "interesting" attributes (ie. the ones I find myself changing most often) are bolded, to assist the user when scanning down them: text-align: font-size: and text-indent: Those of you not CSS savvy, basically if you look for any references to text-align: left and change them to text-align: justify, that should do the trick. On some LIT conversions I've seen double paragraph indentation happen - usually this is because there's a base style called section AND individual styles for the paragraphs, both with an indent. If you remove the text-indent line from the section style, that'll resolve the double indent. This has not been tested to any great degree so you are advised to back up any EPUBs first! It's also only been tested on a Mac (but it's Java, so should run OK on pretty much anything). To use, download the file, BUT DO *NOT* EXTRACT THE ZIP. Instead, rename it from epub-tweaker.zip to epub-tweaker.jar. If you have Java you should then be able to run it by double-clicking, and load an EPUB from the File menu. |
|
|
|
|
|
#2 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 277
Karma: 1003456
Join Date: Apr 2008
Location: London. UK
Device: iBooks on iPad/iPhone 4 (via Calibre)
|
Wonderful! I was wondering about something to do just that (see http://www.mobileread.com/forums/showthread.php?t=69837).
Your script works on my Mac! I will tinker with it in depth shortly, but it looks like just what I want to amend CSS from ePub titles that I have purchased, but which don't render nicely on the PRS-600 or iPhone. Brilliant stuff. Many thanks. Last edited by ChristopherTD; 01-21-2010 at 02:46 AM. |
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,368
Karma: 1119112
Join Date: Aug 2009
Location: TAS, Australia
Device: Astak Pocket Pro (Black), 2 x Kindle WiFi (Graphite), iPod Touch 4G
|
Absolutely brilliant. I posted a while ago about converting from .LIT to .EPUB with text justification problems. This java app solves the problem. Just for your reference I ran it on Ubuntu 9.10 without any issues.
Thanks for posting the app. |
|
|
|
|
|
#4 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 277
Karma: 1003456
Join Date: Apr 2008
Location: London. UK
Device: iBooks on iPad/iPhone 4 (via Calibre)
|
Outstanding! Using this I was quickly able to refine a troublesome book so that it easy to read on my PRS-600.
Many, many thanks for such a wonderful little utility! |
|
|
|
|
|
#5 | ||
|
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,323
Karma: 11288999
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7, Sony PRS-950, Sony PRS-505, PRS-300
|
Quote:
Quote:
Anyway Kudos for creating a tool to help the community here.
__________________
-- Good Reading, Walt -- 20GB of free CLOUD STORAGE: Use this link to sign up for a free 15GB Copy.com cloud storage account and we both get an extra 5GB of free space. |
||
|
|
|
|
|
#6 | |
|
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Dec 2009
Device: Cool-ER
|
Quote:
) extra CSS. I wanted to be able to quickly and easily modify one single parameter of one single CSS style on my EPUB. Basically I want to control, exactly, what the CSS says - not to add additional, potentially contradicting rules. For example, on the extra CSS area, how would you go about modifying a particular style's text-justify parameter from left to justify? It's also a lot lighter weight than Calibre proper if all you want to do is quickly change from left to right justify, or tweak indention or font sizes.
|
|
|
|
|
|
|
#7 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 277
Karma: 1003456
Join Date: Apr 2008
Location: London. UK
Device: iBooks on iPad/iPhone 4 (via Calibre)
|
Also, if you are tweaking the CSS for a book purchased in ePub format, this avoids the need to do an ePub-2-ePub conversion in Calibre (a usually harmless step, but one that cannot easily be undone).
|
|
|
|
|
|
#8 |
|
Mobile Reader Geek
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 34,228
Karma: 13801376
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad
|
Providing the eBook has no DRM or you are able to strip the DRM.
__________________
|
|
|
|
|
|
#9 | |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
|
Quote:
![]() That said, your utility is awesome... I gave it a shot and it looks like it will be really handy. Nice one! |
|
|
|
|
|
|
#10 | |
|
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,323
Karma: 11288999
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7, Sony PRS-950, Sony PRS-505, PRS-300
|
Welcome to Mobileread.
![]() Quote:
This feature is essentially built into calibre via the right click menu. Select the book you wish to tweak in calibre's library view. Right click the book and choose Tweak Epub, explode the epub and open the css in your favorite editor, I use notepad++. Edit and save the css, rebuild epub.
__________________
-- Good Reading, Walt -- 20GB of free CLOUD STORAGE: Use this link to sign up for a free 15GB Copy.com cloud storage account and we both get an extra 5GB of free space. |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hacked AdobeViewer.app with userstyle1.css | tselling | PocketBook | 62 | 10-29-2012 10:40 PM |
| converting to epub with my css | fbrzvnrnd | Calibre | 3 | 04-15-2010 02:46 AM |
| ePub to ePub - just replace CSS? | ChristopherTD | Calibre | 21 | 02-11-2010 02:50 AM |
| Modifier le .css d'un .epub | freak | Software | 9 | 11-26-2009 03:58 AM |
| Firefox Tweaker: Flexbeta FireTweaker XP | Alexander Turcic | Lounge | 0 | 08-16-2004 04:51 AM |