Haml

Template: Infobox file format / Maintenance / MIME missing template: Infobox file format / Maintenance / Magic number missing template: Infobox file format / Maintenance / default missing

Haml (HTML Abstraction Markup Language) is a under the MIT license published simplified markup language that is used to describe in a clear and simple way the XHTML a web document, without having to enter mix executable code using inline coding. It is designed to avoid many of the weaknesses of traditional template mechanisms and to make as elegant as it can be just about markup language. Haml functions as a replacement for inline template mechanisms such as those common in PHP, JSP, ASP or RHTML. Haml avoids the need to explicitly encode in XHTML templates, because it is a description for XHTML, with some code for dynamic content itself.

The scope of Haml belonged with Sass also an analogue to CSS. Today, however, Sass and Haml are developed separately versioned and delivered.

Principle

Disadvantages

  • In Haml space has an essential importance. Haml relies on consistent indentation. Tabs and spaces must be used over the entire document consistent.
  • There are (still) no WYSIWYG Editors for Haml, while those available for XHTML and HTML in large numbers. But the growing community of Haml user has a bunch of additives to many popular integrated development environments such as Eclipse ( including popular derived therefrom tools like RadRails or Aptana ), jEdit, NetBeans and editors like TextMate, Emacs or Vim spawned. These allow developers to edit Haml in an environment that takes into account the indentation and syntax.

Example

Note: You please note that this example does not necessarily reflect the present state of development of Haml.

! % html {: xmlns => " http://www.w3.org/1999/xhtml ", : lang = > " en", " xml: lang " => "en "}    % head      % title BoBlog      % meta { "http -equiv " => "Content-Type ": content => "text / html; charset = utf -8 "}      Stylesheet_link_tag = 'main'    % body      # header        % h1 BoBlog        % h2 Bob's Blog      # content        - @ Entries.each do | entry |         . entry            h3.title % = entry.title            p.date % = entry.posted.strftime ("% A, % B% d,% Y")            p.body % = entry.body      # footer        % p          All content copyright © Bob The above Haml text should give the following XHTML:

< DOCTYPE html PUBLIC "- / / W3C / / DTD XHTML 1.0 Transitional / / EN " " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >         BoBlog </ title>      < meta content = 'text / html; charset = utf -8 'http -equiv =' Content-Type '/ >      <link href="/stylesheets/main.css" media="screen" REL="stylesheet" type="text/css" />    </ head>    <body>      <div id='header'>        <h1> BoBlog < / h1 >        <h2> Bob's Blog < / h2 >      </ div>      <div id='content'>        <div class='entry'>          <h3 class='title'> Halloween < / h3 >          <p class='date'> Tuesday, October 31, 2006 </ p>          <p class='body'>            Happy Halloween, glorious readers! I'm going to a party this evening ... I'm very excited.          </ p>        </ div>        <div class='entry'>          <h3 class='title'> New Rails templating engine < / h3 >          <p class='date'> Friday, August 11, 2006 </ p>          <p class='body'>            There's a very cool new templating engine out for Ruby on Rails. It's called Haml.          </ p>        </ div>      </ div>      <div id='footer'>        <p>          All content copyright © Bob        </ p>      </ div>    </ body> </ html> implementations </p> <p> The official Haml implementation was developed for Ruby plugins for Ruby on Rails and Merb, but the Ruby implementation also works independently (without Rails and Merb without ). </p> <p> There are also implementations in other programming languages ​​: </p> <ul> <li>GHRML (Python) </li> <li>HamlPy (Python) </li> <li>LuaHaml ( Lua ) </li> <li></li> <li>NHaml (. NET) </li> <li>Fammel (PHP) </li> <li>PHAML (PHP) </li> <li>Phamlp (PHP) </li> <li>PhpHaml ( PHP5 ) </li> <li></li> <li>Text :: Haml ( Perl) </li> <li>Scalate (Scala) </li> <li>JHaml (Java) </li> </ul> <h2> Development </h2> <p> Haml was invented in May 2006 by Hampton Catlin. Together with Nathan Weizenbaum He developed the code base. </p> </section> <section class="relLinks"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- memim 1 wide adaptive --> <ins class="adsbygoogle" style="display:block;clear:both;" data-ad-client="ca-pub-8545452838648870" data-ad-slot="6796476374" data-ad-format="auto"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <a href="/eruby.html">ERuby</a> <a href="/sass-stylesheet-language.html">Sass (stylesheet language)</a> <a href="/whitespace-character.html">Whitespace character</a> <a href="/markaby.html">Markaby</a> <a href="/yaml.html">YAML</a> </section> <div class="comments"> </div> <section> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-8545452838648870" data-ad-slot="9697283175"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </section> <span style="font-size:.5em">371865</span> <div class="share_buttons"> <div class="addthis_sharing_toolbox"></div> </div> </main> </div> </td></tr><tr><td id="footer"> <div class="aligner"> <footer class="mainHolder" style="text-align:center;"> <!--LiveInternet counter--><script type="text/javascript"><!-- document.write("<a href='http://www.liveinternet.ru/click' "+ "target=_blank rel=nofollow><img src='//counter.yadro.ru/hit?t18.5;r"+ escape(document.referrer)+((typeof(screen)=="undefined")?"": ";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth? screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+ ";"+Math.random()+ "' alt='' title='LiveInternet' "+ "border='0' width='88' height='31'><\/a>") //--></script><!--/LiveInternet--> <br /> memim.com 2024<br /> All rights reserved<br /> <span style='font-size:0.5em'>Page generated in 0.0021<br /></span> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5093bb6e1c1ddca0"></script> <script> function jr(ready){ if(window.jQuery){ //ready(); }else{ setTimeout(jr,100,ready); } } jr(function() { $(".imagesHolder img").each(function () { var i=$(this); console.log(i.attr('src')+' '+i.width()+' '+i.readyState); //$(this).remove(); }); }); </script> </footer> </div> </td></tr></table> <span style="font-size:.3em">de</span> </body> </html>