View Single Post
Old 04-07-2025, 03:00 PM   #3761
graycyn
Wizard
graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.
 
Posts: 1,591
Karma: 11722446
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Pocketbook Era, Kobo Forma, Kindle Oasis 2
Quote:
Originally Posted by Sirtel View Post
Of course I didn't mean blindly converting anything. In most books there is a difference between the code for paragraph spacing and the code for section breaks. It will be a ton of work only if there is no difference between the two at all, but that's rare.

Speaking of nutty css, I just finished editing one of the worst examples of this. I have no idea how they formatted the book (just typing everything in by hand, without using any styles or rules?), because there were several hundred different rules for ordinary paragraphs, section breaks, blockquotes and so on - each one had slightly different margins (for example, one paragraph had a bottom margin 5pt, another 6pt; a blockquote had left and right margins 15pt, another 16pt, still another 15pt left and 20pt right, etc. etc. A total madhouse), so they had to be edited manually one by one, no bulk search/replace or regex. Took me two days. Grrr.
I hear you. I decided to clean up a quite old epub (2010) that I'd never read (a freebie), but one I've always meant to read. Well, Calibre was having a hard time with it, i.e. really slow. So I went in, looked at the code and there was a style set up in the head in each and every HTML file. And that style file consisted of about 3 zillion or so font declarations. It was, I kid you not, 6200+ lines of completely unnecessary code! In every blamed HTML file, all 28 of them! The ebook did not have any embedded fonts whatsoever. It looked like someone had just decided to reference every dang font on their machine when they made the ebook. I'd never heard of half the fonts. Needless to say, that was a head-shaker!

And not terribly fun to get rid of, since I couldn't select the whole mess for find/replace. No blame to Calibre, who'd think you'd ever need to do something like that? With some experimentation, I was finally able to select about 500 lines of the file for find/replace, Calibre could handle that OK and I got it done, 500 lines at a whack. Hopefully I'll actually enjoy the book....

Last edited by graycyn; 04-07-2025 at 03:06 PM.
graycyn is offline   Reply With Quote