I’ve put probably (if no major problems occcur) the last but in any case the first beta release of cssutils online. Mainly a few improvements and bugfixes, a bit more docs and a thing here or there. The main feature may be a “combine” script which resolves @import rules in a sheet. Idea is to have a simple “proxy” CSS loaded from an HTML page which then loads all other needed CSS files (for e.g. layout, modules, colors or however you structure your CSS files). For production the “combine” script should be run which resolves the @imports in the proxy script (no nested imports yet!) and saves the resulting SINGLE CSS files optionally minified for deployment. The HTML does not have to be changed as the proxy ideally contains all needed CSS rules now. But for development a nice structure of CSS files may be used and kept…
Anyway, cssutils 0.9.5 will (probably) be adding better support for selectors, ideally it will be possible to query a cssutils stylesheet for styles for certain elements or documents. As this means building the complete first C of CSS (the Cascade) this will probably take a bit longer. But I guess it will make cssutils at least a bit more useful than just being a very big pretty printer…
BTW, I need to define which CSS hacks survive cssutils. I guess mostly hacks in the bounds of valid CSS will survive, currently the only non-valid hack “$propname” (used for IE) does survive. Anyway, something for next year
Noticing the the Django book is final I began reading it today (I wanted to look into Django for some time now but never really came to it). Anyway the book is quite nice, easy reading with simple examples (a bit too targeted to beginners which I guess I am not really anymore).
To try the examples I downloaded the newest Django release (0.96.1 I think), untared it and started
setup.py. Funny enough this simple step failed… After looking into the source of setup.py I noticed this line:
package = dirpath[len_root_dir:].lstrip('/').replace('/', '.'). Being on Windows this of course failed and I changed it to ‘\\’. I guess one should use
os.path.sep in this case so I decided to add a proper bug report to the Django Trac. Again this simple idea failed as my short post was not allowed as the system thought of it as spam
So I gave up on this. Two simple things failing does demotivate me…
But I started reading the book anyway and tried the examples too (after the hacked install ). Until Chapter 4 where I am currently it all makes sense (should do with Djangos good reputation). I am not quite sure if another templating system was needed though. I still prefer XSLT for templating as it gives me total freedom about the HTML and if the source XML is based on XHTML it is not even difficult to write or understand. A few well-placed added elements (in another namespace) do all what I want in theses cases (e.g. a menu renderer). Anyway Djangos templating and its philosophical background seem to make sense but look like JATS in the end.
As a side note, I use web.py at work for a small project at the moment. It works very well and XSLT usage was very simple to add. I guess Django is better for more complex apps but web.py is fine for simple stuff. Documentation is lacking though and I don’t think there will be any “web.pybook” soon
Again a new alpha version has been released, not that it is really more alpha than all betas or even full releases before but mostly as it is not “fully” tested.
For the future I am not really sure where to go. I guess focusing on improvement of the usage of the library (simplify API e.g.) would be the best. cssutils till now is just a lib which can parse a given CSS and enhance/change it on the level of specific rules or build a new CSS from scratch. It is not possible to “render” anything but not even possible to query it on maybe a given HTML or XML document or a given CSS selector. So I guess the heavy work like reading the Cascade properly or get a single property value for a given element from a given CSS style sheet set can be built on top of it but rightfully should be part of cssutils.
It started as a pretty printer which it does not that bad, CSS hacks might get lost though and also not all CSS possible constructs are parsed as they should, try e.g. an advanced PrinceXML CSS sheet and see what is lost. Validation of simple (not necessarily short of course) sheets does work quite well too. It is not as bad as it sounds I guess – the average CSS should be handled quite well (and other CSS implementations have their problems too) but still sometimes it makes me fell depressed having done so much but hardly enough…
Generally cssutil should have more uses than that. Problem as always is time and also as most CSS implementation lack a full compliant implementation (even Operas or Firefox) I fear cssutils can only be even worse
Let’s see how much time I can spare over christmas, maybe I try something like a query functionality…