Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 07-23-2014, 11:04 AM   #766
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,931
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I've just run the latest version of Modify ePub and I do like the unpretty part. Saves me from having to load into Sigil to fix some not so good formatting of the XML.
JSWolf is offline   Reply With Quote
Old 07-23-2014, 09:08 PM   #767
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,931
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I have a request. Would it be possible for the unpretty (de-indent) routine to not double space?
JSWolf is offline   Reply With Quote
Advert
Old 07-23-2014, 09:19 PM   #768
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by JSWolf View Post
I have a request. Would it be possible for the unpretty (de-indent) routine to not double space?
It's possible, but I'm not going to do it. One of the benefits of double-spacing is that it makes "unwrapping" paragraphs much easier in some editors...which I find to be a useful feature.

If you don't like the double-spacing, just open the book in Calibre's editor and replace \n+ with \n in All text files, using Regex mode. Done.
Rev. Bob is offline   Reply With Quote
Old 07-24-2014, 11:16 AM   #769
icallaci
Guru
icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.
 
Posts: 766
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
I hesitate to ask for this (it may be my OCD showing), but would it be possible for Modify ePub to have an option to clean up the CSS file (put classes in alphabetical order, make the formatting/indenting/spacing consistent)? Some stylesheets are such a mess that I can't scan them easily. Sometimes I miss classes with identical names--some are duplicates but some are not, and if they were in alphabetical order, at least I could view them together and consolidate or remove duplicates. Sometimes individual properties are all on a single line, sometimes they are on separate lines, sometimes a property has a colon plus a space after the property name, sometimes it has a colon with no space... These things turn a simple search into a regex adventure, which is a pain. Calibre's conversion process handles most of these, but I'd rather not deal with the side effects of conversion. Anyway, just a suggestion, and thank you for the work already done in this essential plugin.
icallaci is offline   Reply With Quote
Old 07-24-2014, 11:51 AM   #770
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: 29,791
Karma: 54830978
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 icallaci View Post
I hesitate to ask for this (it may be my OCD showing), but would it be possible for Modify ePub to have an option to clean up the CSS file (put classes in alphabetical order, make the formatting/indenting/spacing consistent)? Some stylesheets are such a mess that I can't scan them easily. Sometimes I miss classes with identical names--some are duplicates but some are not, and if they were in alphabetical order, at least I could view them together and consolidate or remove duplicates. Sometimes individual properties are all on a single line, sometimes they are on separate lines, sometimes a property has a colon plus a space after the property name, sometimes it has a colon with no space... These things turn a simple search into a regex adventure, which is a pain. Calibre's conversion process handles most of these, but I'd rather not deal with the side effects of conversion. Anyway, just a suggestion, and thank you for the work already done in this essential plugin.
You can 'beautify' just the CSS with ebook-edit ( if you are looking at the CSS, you are probably editing something. 1 click and it is pretty-er).
Sigil has the reformat CSS right-click option. Both make the CSS have a standard layout (colon space), but a \s* between the colon and the argument will take care of the REGEX search problem


Neither sorts. Both have clean unused styles.
theducks is offline   Reply With Quote
Advert
Old 07-24-2014, 01:07 PM   #771
icallaci
Guru
icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.
 
Posts: 766
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
[QUOTE=theducks;2881659]You can 'beautify' just the CSS with ebook-edit ( if you are looking at the CSS, you are probably editing something. 1 click and it is pretty-er).
QUOTE]

Aha, I didn't know that. Thanks. All I need now is to alphabetize the classes.
icallaci is offline   Reply With Quote
Old 07-24-2014, 02:52 PM   #772
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by icallaci View Post
I hesitate to ask for this (it may be my OCD showing), but would it be possible for Modify ePub to have an option to clean up the CSS file (put classes in alphabetical order, make the formatting/indenting/spacing consistent)?
Not really my call. At present, I'm trying to nail down these three new routines, none of which deal with this, before handing the development reins back over to kiwidude.

That said, there are several ways to clean up CSS files, some of which have already been mentioned. One of my favorite methods is to open the book with Calibre's editor, add a new (and thus unused) class to the CSS sheet in question, and then use the Tools > Remove unused CSS rules option. (Name is from memory; I'm on my iPad right now.) Not only will that tool remove the unused classes, but it will also reformat the affected sheets to a readable standard. It doesn't do any reordering, though, as sometimes the sequence of rules within a stylesheet matters. Specifically, later rules override earlier rules. (Real example: One sheet defined * { margin: 0; } and then blockquote { margin: 1em 1.5em; } - if you reverse that sequence, blockquote loses its margins.)

Yes, if the styles are all independent, the order doesn't matter. However, in my experience, the big long sheets that are hard to wade through are most commonly template-related sheets that contain a lot of unused rules. Clear those out, and things look a lot better really fast.
Rev. Bob is offline   Reply With Quote
Old 07-24-2014, 06:03 PM   #773
icallaci
Guru
icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.
 
Posts: 766
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
Understood about rule sequence. It's just that I've had a few stylesheets lately that either duplicate entire classes verbatim or override many/most of the properties in those classes. If classes with the same names could be grouped together, I could see what is happening a whole lot easier. Calibre's conversion process does this, and so far it hasn't created any problems in that respect, but it also consolidates classes, which I don't want. But knowing how to reformat the stylesheet helps a lot, so I am reasonably satisfied for the moment. Thanks.
icallaci is offline   Reply With Quote
Old 07-24-2014, 06:11 PM   #774
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
For something like that, you may want to check out http://cleancss.com/ - copy the sheet's CSS into the box, set your selections as you wish, and let 'er rip. Quick, good, and pretty painless (aside from being an online tool rather than an integrated one).

I used CleanCSS on one book that had apparently been written with one sheet/chapter, then all the classes got mass-renamed so all the sheets could be crammed into one document. You'd end up with, for instance, .center, .center1, .center2, and so on through about .center29 - and they're all identical. CleanCSS combines those together, and then you can use Calibre's search/replace feature to reduce the references to all those different classes if you want. That part can be tedious, but at least it's possible once everything's been combined.

Last edited by Rev. Bob; 07-24-2014 at 06:15 PM. Reason: Remembered a useful example.
Rev. Bob is offline   Reply With Quote
Old 07-24-2014, 10:25 PM   #775
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Sorting the stylesheet sounds like an something the editor should do. And as Kovid has announced support for editor plugins in the next release, that would be a good way to add the function.
davidfor is offline   Reply With Quote
Old 07-24-2014, 10:41 PM   #776
icallaci
Guru
icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.
 
Posts: 766
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
Quote:
Originally Posted by Rev. Bob View Post
For something like that, you may want to check out http://cleancss.com/ - copy the sheet's CSS into the box, set your selections as you wish, and let 'er rip. Quick, good, and pretty painless (aside from being an online tool rather than an integrated one).
I'll take a look at it. Sounds like it might get me halfway there. Thanks. (But I'd still like to see a plugin with the ability to sort stylesheet classes )
icallaci is offline   Reply With Quote
Old 07-24-2014, 10:47 PM   #777
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,931
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by icallaci View Post
I'll take a look at it. Sounds like it might get me halfway there. Thanks. (But I'd still like to see a plugin with the ability to sort stylesheet classes )
Personally, I would not mind if Modify ePub cleaned up the stylesheet. But reordering it, nope, things could break.
JSWolf is offline   Reply With Quote
Old 07-25-2014, 01:49 AM   #778
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by davidfor View Post
Sorting the stylesheet sounds like an something the editor should do. And as Kovid has announced support for editor plugins in the next release, that would be a good way to add the function.
I couldn't resist. See Sort CSS plugin.
davidfor is offline   Reply With Quote
Old 07-25-2014, 10:35 AM   #779
icallaci
Guru
icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.
 
Posts: 766
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
Quote:
Originally Posted by JSWolf View Post
Personally, I would not mind if Modify ePub cleaned up the stylesheet. But reordering it, nope, things could break.
I'd like to reorder it to check dups, but not necessarily save the reordered version. Finding duplicate classes is so tedious that DavidFor's new plugin will make this way easier. Thanks, DavidFor.
icallaci is offline   Reply With Quote
Old 07-25-2014, 11:08 AM   #780
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,931
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by icallaci View Post
I'd like to reorder it to check dups, but not necessarily save the reordered version. Finding duplicate classes is so tedious that DavidFor's new plugin will make this way easier. Thanks, DavidFor.
Why not then ask for a duplicate class checker instead of reordering?
JSWolf is offline   Reply With Quote
Reply

Tags
modify epub


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 1184 04-17-2024 06:17 PM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 08:39 AM
[GUI Plugin] Manage Series kiwidude Plugins 166 02-13-2024 11:31 AM
Modify ePub plugin dev thread kiwidude Development 346 09-02-2013 05:14 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 04:34 AM.


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