View Single Post
Old 06-12-2012, 03:10 PM   #43
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,970
Karma: 128903378
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 Hitch View Post
Well...the iterations would be fairly massive, I'd think.

I mean, you'd have to (I don't program, so--those with real brains, leap in) aggregate ALL the styles and elements; probably doing so from the top-down, so most-used to least-used makes the most sense; search for all instances of "p," first, and then all classes used in the ePUB--and then do a string-match in the CSS...does that sound right, ye olden programmers? I mean, it seems more efficient to do it by element and then by class, but sometimes, what seems elementary (sorry, sorry, you guys KNOW I can't resist bad punnage!) isn't.

We use something SOMEWHAT like this in two places; we have a PERL script and an NTPro script that both check for this--but it's in the HTML. I don't know how we'd adopt it to run inside Sigil, unless we took the additional steps of copying the file, merging it, and exploding it, but even so...it would be a SLICK addition in Sigil. I would infinitely rather the "used in the ePUB but not in the stylesheet" functionality than simply cleaning up the Stylesheet. I know some folks need that--and it would be nice fudge topping--but it's not as needed as the inverse. We have a House CSS that we use, so cleanup isn't as important for us, in the CSS itself...but I think everyone would love the missing classes thing.

JMHO,
Hitch
I would think that finding orphaned classes and unused style classes should be the job of FlightCrew.
JSWolf is offline   Reply With Quote