This is not the document you are looking for? Use the search form below to find more!

Report home > Others

Intro to Haml

0.00 (0 votes)
Document Description
Intro to Haml
File Details
  • Added: April, 14th 2011
  • Reads: 154
  • Downloads: 1
  • File size: 1.28mb
  • Pages: 13
  • Tags: haml
  • content preview
Submitter
  • Name: joline

We are unable to create an online viewer for this document. Please download the document instead.

Intro to Haml screenshot

Add New Comment




Related Documents

SIGN SYMBOL LOGO (Intro to GD, Wk 3)

by: bela, 89 pages

SIGN SYMBOL LOGO (Intro to GD, Wk 3)

Intro to the Internet

by: technate, 10 pages

Intro to the Internet

intro to reason

by: rezkon, 459 pages

intro to reason good book

Intro to physics practocles

by: vaibhavroys, 22 pages

Intro to physics practocles

Week Seven - Intro To Video

by: aldous, 27 pages

Week Seven - Intro To Video

Ns1 1.0 Intro to Military Drill

by: hossein, 73 pages

Ns1 1.0 Intro to Military Drill

Intro To Erlang

by: mandy, 58 pages

Intro To Erlang

CSC384: Intro to Artificial Intelligence Prolog Tutorials 1

by: yesse, 21 pages

CSC384: Intro to Artificial Intelligence Prolog Tutorials 1

Intro to c# (vs. objective c and java)

by: jayden, 23 pages

Intro to c# (vs. objective c and java)

An intro to critical thinking, skepticism & quirkology

by: sebastiaan, 32 pages

An intro to critical thinking, skepticism & quirkology

Content Preview
HAMLor, how to get <arrowheads> out of your facePresented by Clifford HeathIs THIS YOU?when you see...<div id="column1" class= "robust"> <div class="sidebaritem"> <div class="sbihead"> <h1>Status Watch</h1> </div> <div class="sbicontent"> <%= render :partial => 'layouts/sidebar', :locals => { :value =>@mvalue } %> </div> </div> <div class="sidebaritem"> <div class="sbihead"> <h1>Your Account</h1> </div> <div class="sbilinks"> <ul> <% if session[:user_id] %> <li><%= link_to 'Log Out', :controller => 'authenticate', :action => 'logout' %></li> <% if @user && @user[:is_admin] -%> <li><%= link_to "Administration", :controller => 'admin', :action => 'index' %></li></etc></etc></etc> the right number of times ...With HAML...#column1.robust .sidebaritem .sbihead %h1 Status Watch .sbicontent = render :partial => 'layouts/sidebar', :locals => { :value =>@mvalue } .sidebaritem .sbihead %h1 Your Account .sbilinks %ul - if @user %li= link_to 'Log Out', :controller => 'authenticate', :action => 'logout' - if @user[:is_admin] %li= link_to "Administration", :controller => 'admin', :action => 'index' What’s Changed? All <arrowheads> are goneTags and code both self-close by indentationid=”xyz” and class=”abc” are just #xyz and .abc<div> is the default tag - for others, use %tag<%= some code %> is now just = some codeSame for <% some code -%>, use - some codeVisual SimplicityThe RHTML version has 261 lexical tokenscounting each word in strings and syntactic white-spaceThe HAML version has 117 tokensThat makes it easier on the eyes and the fingers!Markup HaikuRead it again...#column1.robust .sidebaritem .sbihead %h1 Status Watch .sbicontent = render :partial => 'layouts/sidebar', :locals => { :value =>@mvalue } .sidebaritem .sbihead %h1 Your Account .sbilinks %ul - if @user %li= link_to 'Log Out', :controller => 'authenticate', :action => 'logout' - if @user[:is_admin] %li= link_to "Administration", :controller => 'admin', :action => 'index' Extra benefitsNeed care to close tags correctly in RHTMLIn HAML, generated code is indented properlyincluding after nesting layouts and partials!valid XHTML with no extra effortDIVs almost always get a class or an ID or bothPlays well with RHTML during conversionOther nicetiesAttribute values are Ruby code:%label{:for=>@field.name}= @field.description+’:’Ruby blocks are automatically closed:%table - @people.each do |person| %tr %td= person.name%p.footer You can declare multiple classes, etc:%td.person.alignleft#husband= @husband.nameOther niceties... 2ID and class attributes can come from an object:%div[@mother]uses @mother.class and @mother.id to become:<div class=”person” id=”person_5724”>Most self-closing tags are recognisedothers may be declared self-closed: %br/Comments start with a single / and are output!Even multi-line; a comment wraps indented content

Download
Intro to Haml

 

 

Your download will begin in a moment.
If it doesn't, click here to try again.

Share Intro to Haml to:

Insert your wordpress URL:

example:

http://myblog.wordpress.com/
or
http://myblog.com/

Share Intro to Haml as:

From:

To:

Share Intro to Haml.

Enter two words as shown below. If you cannot read the words, click the refresh icon.

loading

Share Intro to Haml as:

Copy html code above and paste to your web page.

loading