Skip to content

Instantly share code, notes, and snippets.

@zuigon
Forked from them0nk/haml_cheatsheet.haml
Created March 2, 2014 00:37
Show Gist options
  • Save zuigon/9299963 to your computer and use it in GitHub Desktop.
Save zuigon/9299963 to your computer and use it in GitHub Desktop.
!!! strict
!!! XML
%html
-# Self closing tags
%img{:src => "happy.jpg"}/
%div.myclass
.myclass1
%div#myid.myclass
.myclass#myid
#myid.myclass
%table.aclass#mytableid
%table#mytableid{:class => "aclass"}
%table.aclass{:id => 'mytableid'}
%table{:id => 'mytableid', :class => "aclass"}
.myclass1.myclass2
.myclass2.myclass1
-# This line is a ruby comment
-# The Next line is a ruby statement which will not get printed
- @array = [1,2,3]
- @myclass = "highlight"
%ul
- @array.each do |e|
-# Below all syntax are equivalent
%li{:class => @myclass, :id => e }
= e
%li {:class => @myclass, :id => e} #{e}
%li= e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment