Haml is a templating engine for HTML that uses whitespace indentation to produce clean, DRY markup.
Basics
Doctype
!!!
!!! 5
!!! Strict
!!! Frameset
!!! Mobile
!!! Basic
Tags & Structure
%p Hello World
%span
Inner text
Classes & IDs
%div#content
%p.highlighted Text content
/ Div is the default tag when omitted
.notice
#login-box
Inline Attributes
Both hash syntaxes are supported:
%html{ "xml:lang" => "en", :lang => "en" }
%a{ :href => "/login", :title => "Sign in" }
/ HTML-style attributes syntax
%a(href="/login" title="Sign in")
Ruby Evaluation
= "Evaluated Ruby expression"
- [1, 2, 3].each do |num|
%li= num