09.Apr.2007
Haml is a new markup language for those of you who, like me, think that writing HTML/XHTML/XML is a tiring and useless repetition of tags. Specially design for replacing Rhtml (XHTML with embedded ruby), it can also be used with other similar languages, or simply for replacing XML. Although it may seem a bit weird at first, once you get the basic rules it really gives you more productivity. And the example given at the end of the home page really gets your attention.
Like python, Haml uses indentation to figure out where the blocks of code end. In this case the author as chosen a two spaces indentation, not my favorite choice I must say, so just configure your editors right. The way divs are represented as been really simplified, since it’s probably the most used tag. To try out the new markup language just install the plugin in your application using:
./script/plugin install http://svn.hamptoncatlin.com/haml/tags/stable
After this you only have to save your Haml templates with the .haml extension and they’ll get automatically parsed by the server. The above command also installs the SASS parser, a language used for replacing CSS. However it doesn’t seem like much improvement from CSS, except maybe the lack of braces and the introduction of constants. Maybe not enough reason to stop using the standard.
But Haml is surely a keeper. I advise you to try and convert a XHML/XML/Rhtml template to Haml. Basically you just have to use the delete key and cut down the superfluous characters.
If you enjoyed this post, consider subscribing to my RSS FeedSérgio Santos | Creative Commons | micro theme by seaofclouds, and powered with Mephisto
Leave a Comment
Follow this post comments with this RSS feed.