SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 30 day free trial to unlock unlimited reading.
5.
Main ideas of Haml
Markup should:
● be beautiful
● be clean
● be sensible
● follow the rules
6.
Rules of indentations
.some_div
line one
line two <div class='some_div'> line one line two </div> <div
class='some_div_two'> line one </div>
.some_div_two line two
line one
line two
If we try that:
%h1 test
work?
(<h1> test
work? </h1> )
Immediately we take error:
Illegal nesting: content can't be both given on the same line as %h1 and nested within it.
10.
Any problems with haml?
● Perfomance problems
● Need for retraining
11.
Perfomance
Haml - 0.00033s
ERB - 0.000222s
Slim - 0.000254s
Код:
Haml ERB Slim
%h1 Haml#index %p Find me in <h1>Erb#index</h1> <p>Find me in h1 Haml#index p Find me in
app/views/haml/index.html.erb =@haml app/views/erb/index.html.erb</p> <%= @erb % app/views/slim/index.html.erb = @slim
>
12.
Intuitive perception
Html with css:
<div class="highlight">
this is some stuff
</div>
.highlight {
border: 1px solid #f00 }
Haml with sass:
.highlight
this is some stuff
.highlight
border: 1px solid #f00
13.
Now you can see that Haml is
REALLY better than erb
You also can take a look for my blog graffzon.com