intro to haml

Post on 22-Mar-2016

34 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

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

Intro to HAMLBy Me, Christopher Judge

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

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

What do you mean by faster?

HAML

HTML

What do you mean by faster?

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

What do you mean by faster?

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

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

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:

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

HAML outputs perfectly semantic and valid HTML

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

HAML eliminates the need for typing your tags twice.

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.

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

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

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

Some other awesome stuff.

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

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.

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?

4 Answers 1.Don’t Repeat Yourself

2. Indentation

3.HTML abstraction markup language

4.Ruby

top related