Haml es un motor de plantillas para HTML que utiliza la indentación por espacios para generar marcado limpio y sin repeticiones (DRY).
Conceptos básicos
Doctype
!!!
!!! 5
!!! Strict
!!! Frameset
!!! Mobile
!!! Basic
Etiquetas y estructura
%p Hello World
%span
Inner text
Clases e IDs
%div#content
%p.highlighted Text content
/ Div is the default tag when omitted
.notice
#login-box
Atributos en línea
Se admiten ambas sintaxis de hash:
%html{ "xml:lang" => "en", :lang => "en" }
%a{ :href => "/login", :title => "Sign in" }
/ HTML-style attributes syntax
%a(href="/login" title="Sign in")
Evaluación de Ruby
= "Evaluated Ruby expression"
- [1, 2, 3].each do |num|
%li= num