Download presentation
Presentation is loading. Please wait.
Published byKatrina Foster Modified over 9 years ago
1
Intro to HAML By Me, Christopher Judge
2
What is a HAML? Known as the HTML Abstraction Markup Language. Which uses, “functions as a replacement for inline page templating systems.”- haml-lang.com
3
What is a HAML? “Writing HTML way faster and more efficiently so you have more time to do fun stuff in your life.” - Me
4
What do you mean by faster? HAML HTML
5
HTML elements are created using the percent sign (%) followed by the tag name.
6
What do you mean by faster? ID’s and Classes are represented like CSS selectors and appended to the tags.
7
What do you mean by faster? If there is no HTML tag defined then HAML will insert the div tag for you.
8
Why else should I use HAML? 1. Markup Should be Beautiful 2. Markup Should be DRY 3. Markup Should be Well- Indented 4. HTML Structure Should be Clear Here Are 4 Great Reasons:
9
What do you mean by beautiful? Beautiful refers to the ability for humans to read your markup. HAML outputs perfectly semantic and valid HTML
10
DRY? But I never get my markup wet. D – Don’t R – Repeat Y – Yourself HAML eliminates the need for typing your tags twice.
11
Doesn’t it all go on a single line? “Code should be indented to show tag parent/child relationships.” – Novatnak HAML’s logic relies on the indentation of parents and children.
12
It relies on your indentation? Nesting is controlled via indentation and white space.
13
It relies on your indentation? Nested tags must be indented on a new line.
14
Shouldn’t it naturally be clear? Due to HAML’s logic relying on indentation, your code will always have a clear and concise structure.
15
Some other awesome stuff. Because HAML is compiled using Ruby it can also use Ruby logic.
16
How do I download HAML? Install Ruby: https://www.ruby- lang.org/en/installation/ https://www.ruby- lang.org/en/installation/ Type this into the command line:
17
How does it work? Your HAML is compiled via the command line or another program (CodeKit for me) and then saved as HTML in an external file. It uses the Ruby language to compile it.
18
4 Questions 1. What is the meaning of DRY? 2. HAML’s logic depends on what? 3. What does HAML stand for? 4. What language is HAML compiled in?
19
4 Answers 1. Don’t Repeat Yourself 2. Indentation 3. HTML abstraction markup language 4. Ruby
20
References http://www.sitepoint.com/an- introduction-to-haml/ http://www.sitepoint.com/an- introduction-to-haml/ http://www.cheatography.com/ specialbrand/cheat- sheets/haml/ http://www.cheatography.com/ specialbrand/cheat- sheets/haml/ http://haml.info/
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.