Novelang-0.16.0 released!

Latest release of Novelang available here. This version introduces changes that may break existing documents and stylesheets. — Brand new naming scheme for syntactic nodes! — Chapters and sections don’t exist anymore. All what stylesheets will see are “levels”. — Top-level delimiter (formerly “chapter”) in Part now starting with two equal signs == instead of three asterisks. — Character escape now basing on Unicode name, plus optional HTML entity name. — Option createchapter of the insert command renamed to createlevel. — Updated documentation accordingly. Enjoy! c.


How to drop a feature : CSS for XML

As I was updating documentation for the incoming Novelang-0.16.0 I suddenly got bored that Safari doesn’t display raw XML in a convenient manner. Camino does a far better job by assigning a default CSS and some JavaScript enabling element folding. “Let’s have some fun”, I said to myself. I quickly drafted a CSS applying directly to Novelang’s XML elements. Including the CSS was done with one line of code inside the XmlWriter. XML just needs a processing instruction like this:
<?xml-stylesheet type="text/css" href="/xml.css"?>
As I quickly discovered, this was the wrong approach. CSS have no mean to add the name of the element itself through :before and :after pseudo-selectors, so for each XML element I should add the two selectors and copy-paste the name of the element. And giving the element names a special appearance is not possible, so the element tag would have the same appearance than its delimited content. CSS for XML are fairly limited, indeed. Now I realize that raw XML is only useful for debugging stylesheets, so it’s not a good place to put eye-candy to. If folding makes sense, it would be on default HTML view, for getting an overview of generated levels.