HAML Cheat Sheet by Specialbrand
Total Page:16
File Type:pdf, Size:1020Kb
HAML Cheat Sheet by J Lee (specialbrand) via cheatography.com/395/cs/188/ Doctype Elements Implicit Div Elements !!! <!DO CTYPE html PUBLIC "- %p #collec tion //W 3C/ /DTD XHTML 1.0 A paragraph .item Transit ion al/ /EN " % strong bold .des cri ption What a cool item! "h ttp :// www .w3 .or g/T R/x htm l1/ DTD / is compiled to: is compiled to: xh tml 1-t ran sit ion al.dtd "> <p>A paragraph <str ong >bo ld< /st ron g>< /p> <div id='col lec tio n'> !!! 5 <!DO CTYPE html> < div class=' ite m'> Attributes < div class=' des cri pti on' >What a cool item! !!! Strict <!DO CTYPE html PUBLIC "- </ div > //W 3C/ /DTD XHTML 1.0 %html{:xmlns => < /di v> Strict/ /EN " "http://www.w3.org/1999/xhtml", "xml:lang" => </di v> "h ttp :// www .w3 .or g/T R/x htm l1/ DTD / "e n", :lang => "e n"} xh tml 1-s tri ct.dtd "> is compiled to: Comments !!! <!DO CTYPE html PUBLIC "- <html xmlns=' htt p:/ /ww w.w3 .or g/ 199 9/x html' Frameset //W 3C/ /DTD XHTML 1.0 xml:lan g='en' lang='e n'> </h tml > HTML Comments: / Framese t// EN" %peanut but ter jelly "h ttp :// www .w3 .or g/T R/x htm l1/ DTD / Self-Cl osing Tags / This is the peanutb utt erj elly element xh tml 1-f ram ese t.dt d" > I like sandwic hes! %br is compiled to: %meta{' htt p-e quiv' => 'Conten t-T ype', :content Filters <pea nut but ter jel ly> => 'text/h tml'} < !-- This is the peanutb utt erj elly ellement --> is compiled to: %p I like sandwic hes! :markdown <br /> </pe anu tbu tte rje lly > # Heading <meta http-eq uiv ='C ont ent -Type' Haml Comments: -# H ello, *World* content ='t ext /html' /> %p foo is compiled to: -# This is a comment <p> Escaping HTML %p bar < h1> Hea din g</ h1> &= "I like cheese and cracker s" is compiled to: < p>H ello, <em> Wor ld< /em ></ p> compiles to: <p>f oo< /p> </p> I like cheese &am pamp; crackers <p>bar</p> Some Filters Available To Use Class and ID :plain Does not parse the filtered text. This is useful for large blocks of text %div#things without HTML tags, when you don’t %span#rice Chicken Fried want lines starting with . or - to be %p.beans{ :food => 'true' } The magical fruit parsed. %h1.class.otherclass#id La La La is compiled to: :javasc ri Surrounds the filtered text with <div id='thi ngs '> pt <scr ipt > and CDATA tags. Useful for < span id='ric e'> Chi cken Fried</ spa n> including inline Javascr ipt. < p class=' beans' food='t rue '>The magical :css Surrounds the filtered text with fruit</ p> <sty le> and CDATA tags. Useful for < h1 class=' class othercl ass' id='id' >La La including inline CSS. La</ h1> :sass Parses the filtered text with Sass to </di v> produce CSS output. :textile Parses the filtered text with Textile. :makuru Parses the filtered text with Maruku, which has some non-sta ndard extensions to Markdown. By J Lee (specialbrand) Published 5th January, 2012. Sponsored by CrosswordCheats.com cheatography.com/specialbrand/ Last updated 5th June, 2014. Learn to solve cryptic crosswords! www.specialbrand.net Page 1 of 1. http://crosswordcheats.com.