Intro to HAML

20
Intro to HAML By Me, Christopher Judge

description

Intro to HAML. By Me, Christopher Judge. Known as the H TML A bstraction M arkup L anguage. Which uses, “ functions as a replacement for inline page templating systems.”- haml-lang.com. What is a HAML ?. - PowerPoint PPT Presentation

Transcript of Intro to HAML

Page 1: Intro to HAML

Intro to HAMLBy Me, Christopher Judge

Page 2: Intro to HAML

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

Page 3: Intro to HAML

What is a HAML? “Writing HTML way faster and more efficiently so you have more time to do fun stuff in your life.” - Me

Page 4: Intro to HAML

What do you mean by faster?

HAML

HTML

Page 5: Intro to HAML

What do you mean by faster?

HTML elements are created using the percent sign (%) followed by the tag name.

Page 6: Intro to HAML

What do you mean by faster?

ID’s and Classes are represented like CSS selectors and appended to the tags.

Page 7: Intro to HAML

What do you mean by faster?If there is no HTML tag defined then HAML will insert the div tag for you.

Page 8: Intro to HAML

Why else should I use HAML? 1.Markup Should be Beautiful

2.Markup Should be DRY3.Markup Should be Well-

Indented4.HTML Structure Should be

Clear

Here Are 4 Great Reasons:

Page 9: Intro to HAML

What do you mean by beautiful?Beautiful refers to the ability for humans to read your markup.

HAML outputs perfectly semantic and valid HTML

Page 10: Intro to HAML

DRY? But I never get my markup wet.D – Don’tR – RepeatY – Yourself

HAML eliminates the need for typing your tags twice.

Page 11: Intro to HAML

Doesn’t it all go on a single line?

“Code should be indented to show tag parent/child relationships.” – NovatnakHAML’s logic relies on the indentation of parents and children.

Page 12: Intro to HAML

It relies on your indentation?Nesting is controlled via indentation and white space.

Page 13: Intro to HAML

It relies on your indentation?Nested tags must be indented on a new line.

Page 14: Intro to HAML

Shouldn’t it naturally be clear? Due to HAML’s logic relying on indentation, your code will always have a clear and concise structure.

Page 15: Intro to HAML

Some other awesome stuff.

Because HAML is compiled using Ruby it can also use Ruby logic.

Page 17: Intro to HAML

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.

Page 18: Intro to HAML

4 Questions1.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?

Page 19: Intro to HAML

4 Answers 1.Don’t Repeat Yourself

2. Indentation

3.HTML abstraction markup language

4.Ruby