View Single Post
Old 06-12-2012, 06:05 AM   #40
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by roger64 View Post
Sounds indeed very useful too. Any idea on how to implement it?

What would be the generic search strings to look for these elements in the xhtml files?
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
Hitch is offline   Reply With Quote