-
-
Save samueljseay/7592390 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-# HTML5 doctype | |
!!! 5 | |
!!! strict | |
!!! XML | |
%html | |
-#ie conditionals | |
/[if IE] | |
%a{ href: "http://www.mozilla.com/en-US/firefox/" } | |
%h1 Get Firefox | |
%div.myclass1 | |
-# is equivalent to | |
.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" | |
-# data attributes | |
.myclass{ data: { attribute: "foo" }} | |
-# or | |
.myclass{ :"data-attribute" => "foo" } | |
-#filters | |
%p | |
-#Simply passes the filtered text through to the generated HTML. | |
:plain | |
Lorem ipsum... | |
-#Surrounds the filtered text with a CDATA escape. | |
:cdata | |
Lorem ipsum... | |
-#Works the same as :plain, but HTML-escapes the text before placing it in the document. | |
:escaped | |
Lorem ipsum... | |
-#Parses the filtered text with ERB – the Rails default template engine. | |
:erb | |
Lorem ipsum... | |
-#Parses the filtered text with Textile. Only works if RedCloth is installed. | |
:textile | |
Lorem ipsum... | |
-#Parses the filtered text with Markdown. Only works if RDiscount, RPeg-Markdown, Maruku, or BlueCloth are installed | |
:markdown | |
Lorem ipsum... | |
-#Parses the filtered text with Maruku, which has some non-standard extensions to Markdown. | |
:maruku | |
Lorem ipsum... | |
%ul | |
- @array.each do |e| | |
-# Below all syntax are equivalent | |
%li{:class => @myclass, :id => e } | |
= e | |
%li {:class => @myclass, :id => e} #{e} | |
%li= e | |
-#inline scripts | |
:javascript | |
var number = 42; | |
-#inline coffeescripts | |
:coffee | |
number = 42 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment