What is Haml and Why Do You Support It?

Haml is a markup language designed to make the process of creating HTML easier and more efficient. Haml markup uses indentation to provide structure.

A code example from the Haml web site:

Full documentation is available.

Haml was originally developed for use in Rails applications, and works as a drop-in replacement for ERB. It is distributed as part of merb-more.

Using Haml in Merb

  1. Add the following line to your dependencies.rb:
    dependency "merb-haml", merb_gems_version
  2. Edit your init.rb and update the template engine:
    use_template_engine :haml
  3. Create your templates with the ”.html.haml” extension.
  4. Write some Haml!

Why is it included with the merb stack

merb-haml is included with merb because it is a significant performance improvement over Builder for building XML files. We recommend the use of Haml for XML, even if you use ERB for regular HTML templating.

Editor Support

TextMate users can use the official Ruby Haml.tmbundle. A fork is available on Github.

 
what_is_haml_and_why_do_you_support_it.txt · Last modified: 2008/11/08 21:44 by 68.2.166.234