HAML Cheat Sheet by J Lee (specialbrand) via cheatography.com/395/cs/188/

Doctype Elements Class and ID

!!! 'true' } The magical fruit transitional.dtd"> %h1.class.otherclass#id La La La

!!! 5 is compiled to:

A paragraph bold

is compiled to: !!! Strict XHTML 1.0 Strict//EN" Attributes Chicken Fried "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

The magical fruit

strict.dtd"> %html{:xmlns => "http://www.w3.org/1999/xhtml",

La La La

"xml:lang" => "en", :lang => "en"} !!! Frameset XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- is compiled to: Implicit Div Elements frameset.dtd"> #collection .item Filters Self-Closing Tags .description What a cool item! %p %br :markdown is compiled to: %meta{'http-equiv' => 'Content-Type', :content => # Heading
'text/html'} Hello, *World*
What a cool item!
is compiled to: is compiled to:

Heading

Hello, World

/> Comments

Escaping HTML HTML Comments: /

Some Filters Available To Use &= "I like cheese and crackers" %peanutbutterjelly :plain Does not parse the filtered text. This is / This is the peanutbutterjelly element compiles to: useful for large blocks of text without HTML I like sandwiches! tags, when you don’t want lines starting I like cheese & crackers with . or - to be parsed. is compiled to: :javas Surrounds the filtered text with