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

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-12-2012, 04: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: 9,531
Karma: 43837842
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, 05:11 PM   #47
theducks
Grand Sorcerer
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: 15,250
Karma: 6020307
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
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
 
Advertisement
Old 06-13-2012, 03: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, 05: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: 6,310
Karma: 4898871
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, 06: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: 2,659
Karma: 15280959
Join Date: Apr 2010
Location: Phoenix, AZ
Device: Kindle2, iPad, KindleFire and NookColor
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
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 12:30 PM
Free Broken or unused readers for the Museum eBookLuke Flea Market 0 05-22-2011 07:52 AM
How often should an unused Kobo be charged? Gary_M_Mugford Kobo Reader 2 10-30-2010 11:38 PM
Unutterably Silly Zelda's gallery of used and unused avatars Wetdogeared Lounge 40 05-16-2009 12:31 PM
iLiad The six unused connections design256 iRex Developer's Corner 10 09-13-2006 09:52 AM


All times are GMT -4. The time now is 02:53 AM.


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