Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-18-2020, 09:36 PM   #16
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 571
Karma: 6833703
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by hobnail View Post
I used to try and clean up the html but in my opinion it's more work than is necessary, for my needs. I now take a big sledgehammer and delete all of the original css and replace it with my minimal css as explained here. After "fixing" the css this way all that crap just stops creating problems (although it requires self discipline to not look too much at their horrid html). I'll still remove those spans that are around every word or the classless ones around paragraphs, and I bold the chapter titles when they use p tags instead of h tags.
The I use my CSS as a toolchest it contains most of the styles I am likely to want. Then the last thing I do in cleaning up a book is to "Delete Unused CSS". In some books I might only use three or four rules. In a complex book, I might have to use most rules. I cannot remember having to use all the rules in my CSS in a single book.

Occasionally an ePub has rules not covered by my CSS. In this case I keep the original rules. Usually these relate to lists or tables.
Thasaidon is offline   Reply With Quote
Old 10-18-2020, 11:06 PM   #17
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 8,635
Karma: 39207287
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Forma, Clara HD, Nexus 7 HD, iPad Pro, Tolino epos
Quote:
Originally Posted by Thasaidon View Post
The I use my CSS as a toolchest it contains most of the styles I am likely to want. Then the last thing I do in cleaning up a book is to "Delete Unused CSS". In some books I might only use three or four rules. In a complex book, I might have to use most rules. I cannot remember having to use all the rules in my CSS in a single book.

Occasionally an ePub has rules not covered by my CSS. In this case I keep the original rules. Usually these relate to lists or tables.
Sounds like my graphics sizing CSS. I likely use 3 to 4 in a book but have about 170 of them available.
DNSB is offline   Reply With Quote
Old 10-19-2020, 07:17 AM   #18
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 571
Karma: 6833703
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by DNSB View Post
Sounds like my graphics sizing CSS. I likely use 3 to 4 in a book but have about 170 of them available.
Well if it suits the way you work and your needs that is fine.

I just checked the number of selectors in my CSS and there are twentyfive.

Usually the minimum number of these selectors in a book is three. The maximum is usually 20ish. Added to this may be rules from the original stylesheet for tables, lists and image sizes.
Thasaidon is offline   Reply With Quote
Old 10-19-2020, 07:34 AM   #19
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: 60,052
Karma: 56698693
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
Quote:
Originally Posted by hobnail View Post
I used to try and clean up the html but in my opinion it's more work than is necessary, for my needs. I now take a big sledgehammer and delete all of the original css and replace it with my minimal css as explained here. After "fixing" the css this way all that crap just stops creating problems (although it requires self discipline to not look too much at their horrid html). I'll still remove those spans that are around every word or the classless ones around paragraphs, and I bold the chapter titles when they use p tags instead of h tags.
You do it the hard way as you then have to figure out what classes in the HTML match the classes in your custom CSS. What I do is remove unused CSS and clean up the CSS that exists. I find that it's a lot easier to use the classes that exist (in most cases)and fix them. I do add some of my own classes. But overall it's easier to just fix what's there as in most cases, the class names are meaningless and without seeing what the publisher did it would not be possible to know what was done.
JSWolf is online now   Reply With Quote
Old 10-20-2020, 03:38 AM   #20
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 571
Karma: 6833703
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by JSWolf View Post
You do it the hard way as you then have to figure out what classes in the HTML match the classes in your custom CSS. What I do is remove unused CSS and clean up the CSS that exists. I find that it's a lot easier to use the classes that exist (in most cases)and fix them. I do add some of my own classes. But overall it's easier to just fix what's there as in most cases, the class names are meaningless and without seeing what the publisher did it would not be possible to know what was done.
I have done it your way in the past. It works and it can be quicker but I learned a lot doing it "my waaaaY" As I am retired I do not have to worry about time much anymore. Just keeping myself entertained.

The only important appointment I have is with a thin, black clad gentleman of an agricultural persuasion, who will meet up with me when they are ready. I want to play a game with them while we talk about Terry Pratchett among other things .
Thasaidon is offline   Reply With Quote
Old 10-20-2020, 11:34 PM   #21
deback
Book E d i t o r
deback figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.deback figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.deback figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.deback figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.deback figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.deback figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.deback figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.deback figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.deback figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.deback figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.deback figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.
 
Posts: 387
Karma: 110636
Join Date: May 2015
Device: Laptop
If I don't need to reformat the entire file, I will manually fix certain CSS classes. One example is when the first paragraph is not indented, I will quickly fix it by adding -ni to the end of the current class name using find and replace, and then highlight and copy the original class in the CSS file (to the clipboard), paste it into the CSS file, and add the -ni to the end of the pasted class name, and then change the text-indent to zero.

When the class codes are so messed up in the file, I might decide to reformat all of it. I will copy my entire template CSS file over the .calibre class in the CSS file. Then I'll find and replace all the current classes and change them to my simple class names (like: text, ni, chapter, desc, copy, heading, ded, acks, reviews, epi, contents, etc...class names that describe the text I'm changing and class names that are easy to remember--most publishers don't use these simple class names). When reformatting, I'll only use <span class> for italics (I have a macro for those by hitting F10), for smaller inline text (like capital letters on a sign in the story), and for text with no-italics (for book titles within italicized paragraphs).

While reformatting, I'll periodically hit the Beautify Files button to automatically remove all the </span> codes and to format all the text to remove spaces, etc. When all done reformatting, I'll use the Reports function to find any remaining original classes, fix those, and then I'll hit the Remove Unused CSS, the Beautify Files, the Smarten Punctuation, and the Check Book buttons..
deback is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
remove unused CSS rules rjwse@aol.com Editor 13 09-18-2019 09:39 AM
CSS Rules deback Conversion 1 01-31-2019 03:59 PM
CSS rules Sebastian Kane Calibre 1 07-19-2017 07:25 AM
Remove unused CSS Rules Divingduck Editor 2 06-21-2014 07:51 AM
Conditional CSS rules Jellby ePub 10 01-20-2009 08:32 AM


All times are GMT -4. The time now is 07:21 PM.


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