Haml é um motor de templates para HTML que usa indentação por espaços para produzir marcação limpa e DRY.
Conceitos básicos
Doctype
!!!
!!! 5
!!! Strict
!!! Frameset
!!! Mobile
!!! Basic
Tags e estrutura
%p Hello World
%span
Inner text
Classes e IDs
%div#content
%p.highlighted Text content
/ Div is the default tag when omitted
.notice
#login-box
Atributos inline
Ambas as sintaxes de hash são suportadas:
%html{ "xml:lang" => "en", :lang => "en" }
%a{ :href => "/login", :title => "Sign in" }
/ HTML-style attributes syntax
%a(href="/login" title="Sign in")
Avaliação de Ruby
= "Evaluated Ruby expression"
- [1, 2, 3].each do |num|
%li= num