Haml Course in Chandigarh
Webtech Learning provide the best piratical training in Haml. Haml is Beautiful, DRY, well-indented, clear markup language.
What is it?
Table of Contents
Haml (HTML abstraction markup language) is based on one primary principle: markup should be beautiful. It’s not just beauty for beauty’s sake either; Haml accelerates and simplifies template creation down to veritable haiku.
Code Differences:
Sample Code:
<section class=”container”> <h1><%= post.title %></h1> <h2><%= post.subtitle %></h2> <div class=”content”> <%= post.content %> </div> </section>
.haml (Sample Code)
%section.container %h1= post.title %h2= post.subtitle .content = post.content
Core Principles
Haml’s development as a language is based on adherence to several core principles. These are:
-
Markup Should be Beautiful
Markup should not be used merely as a tool to get browsers to render a page how the author wants it rendered. The rendering isn’t the only thing people have to see; they have to see, modify, and understand the markup as well. Thus, the markup should be just as user-friendly and pleasant as the rendered result.
-
Markup Should be DRY
HTML involves major repetition. Every element is named twice: once before its content and once after. ERB adds even more repetition and unnecessary characters. HAML avoids all of this by relying on indentation, not text, to determine where elements and blocks of code begin and end. Not only does this result in smaller templates, it makes the code much cleaner to look at.
-
Markup Should be Well-Indented
One of the major problems with ERB is that not only does it not encourage well-indented code, it actively makes it challenging, or even impossible, to write. This leads to confusing, unreadable HTML, when it should be well indented and reflecting the underlying structure of the document. Haml automatically properly formats all tags to that it does.
-
HTML Structure Should be Clear
XML and HTML are formats built upon the idea of a structured document. That structure is reflected in their markup, and it should likewise be reflected in meta-markup such as Haml Because Haml’s logic is based on indentation of child elements, this structure is naturally preserved, making the document much easier and more logical for mere humans to read.
Download Haml Latest: 4.0.3 – What’s New?
Contact Us for Training: Webtech Learning SCO 177, SECTOR 37-C, CHANDIGARH, INDIA Mobile: 9915337448