Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-12-2012, 03:33 PM   #46
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
XML doesn't allow orphaned classes. So yes, it does break the XML rules and thus breaks the ePub rules.
I think I'm going to doubt you on this particular transitive property, rule-break assertion. I could be wrong, but I'm going out on a limb and saying "No." Final Answer.
DiapDealer is offline   Reply With Quote
Old 06-12-2012, 04:11 PM   #47
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,792
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 JSWolf View Post
XML doesn't allow orphaned classes. So yes, it does break the XML rules and thus breaks the ePub rules. But, unused styles are not breaking anything.
AFAIK the rule is that unsupported styles must simply be ignored.
(ADE is great at that , they Ignore the whole stylesheet)

I will take that as the style has not been properly defined (orphaned) should be ignored, thus validate.
theducks is offline   Reply With Quote
Advert
Old 06-13-2012, 02:39 AM   #48
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
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 don't know CSS that well, yet, but from what I've seen, the selectors you can use in CSS are very flexible, making it hard to parse. Unless EPUB only uses a subset - something I still need to find out. There are parsers out there, and it may be that one of them might help.

You would have to go through every element and then compare it against every selector to see if there is a match. For finding used but undefined entries you could simplify things by restricting what's checked (ie checking only class attributes and seeing if they match a selector. Checking just for the name doesn't cover everything as a class could only be defined for certain tags...). I created an issue to track this - just reporting on classes used in the HTML.
meme is offline   Reply With Quote
Old 06-13-2012, 04:37 AM   #49
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by theducks View Post
AFAIK the rule is that unsupported styles must simply be ignored.
(ADE is great at that , they Ignore the whole stylesheet)

I will take that as the style has not been properly defined (orphaned) should be ignored, thus validate.
Aren't you mixing CSS and XHTML?

I think in this thread we are talking about "unused styles" when they are defined in the CSS stylesheet, but they never actually apply to anything. And we are using "orphaned classes" when a class is used in the XHTML file, but there's no defined style that applies to this class.

The rule about ignoring unknown/unsupported styles is, as far as I know, a CSS one, and it refers to properties and values, so if you use "margin_top" instead of "margin-top", it is unknown and ignored.

Again, as far as I know, there is no rule that says that an orphaned class (a class used in XHTML but with no specific style defined for it) is wrong. Maybe in XML it is, but in XHTML? How would you apply a custom stylesheet to any document if you don't know all the class names used? (An XHTML could use <p> for its paragraphs, another <p class="text"> and another <p class="normal">, all of them should work fine if you just define a style for "p" in the CSS, no need for "p.text" and "p.normal".)
Jellby is offline   Reply With Quote
Old 06-13-2012, 05:23 AM   #50
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,461
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 meme View Post
I don't know CSS that well, yet, but from what I've seen, the selectors you can use in CSS are very flexible, making it hard to parse. Unless EPUB only uses a subset - something I still need to find out. There are parsers out there, and it may be that one of them might help.

You would have to go through every element and then compare it against every selector to see if there is a match. For finding used but undefined entries you could simplify things by restricting what's checked (ie checking only class attributes and seeing if they match a selector. Checking just for the name doesn't cover everything as a class could only be defined for certain tags...). I created an issue to track this - just reporting on classes used in the HTML.
Yup, that's the problem. There's no limit, literally, to the number of classes you can have for an element. I mean, it's the equivalent of not knowing what you don't know.

It's not the elements...it's the limitless number of classes that a designer can create, particularly if they're on the fly, or, worse (for us, anyway), we get an INDD file. Man...hard for me to say enough about that.

Hitch
Hitch is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Buy Broken or unused readers for the Museum eBookLuke Flea Market 14 05-06-2012 11:30 AM
Free Broken or unused readers for the Museum eBookLuke Flea Market 0 05-22-2011 06:52 AM
How often should an unused Kobo be charged? Gary_M_Mugford Kobo Reader 2 10-30-2010 10:38 PM
Unutterably Silly Zelda's gallery of used and unused avatars Wetdogeared Lounge 40 05-16-2009 11:31 AM
iLiad The six unused connections design256 iRex Developer's Corner 10 09-13-2006 08:52 AM


All times are GMT -4. The time now is 07:29 AM.


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