Also known as HTML Abstraction Markup Language
Haml (HTML Abstraction Markup Language) is a templating system that is designed to avoid writing inline code in a web document and make the HTML cleaner. Similar to other template systems like eRuby, Haml also embeds some code that gets executed during runtime and generates HTML code in order to provide some dynamic content. In order to run Haml code, files need to have a extension. These files are similar to .erb or .eRuby files, which also help embed Ruby code while developing a web application.
Haml is a templating engine for HTML. It's designed to make it both easier and more pleasant to write HTML documents, by eliminating redundancy, reflecting the underlying structure that the document represents, and providing an elegant syntax that's both powerful and easy to understand. To use Haml with Rails, simply add Haml to your Gemfile and run bundle . If you'd like to replace Rails's ERB-based generators with Haml, add haml-rails to your Gemfile as well. No end-tag is needed; Haml handles that automatically. If you prefer HTML-style attributes, you can also use: Adding class and id attributes is even easier. Haml uses the same syntax as the CSS that styles the document: Haml uses indentation to bring the individual elements to represent the HTML structure. A tag's children are indented beneath than the parent tag. Again, a closing tag is automatically added. For example: It's also possible to embed Ruby code into Haml documents. An equals sign, = , will output the result of the code. A hyphen, - , will run the code but not output the result. You can even use control statements like if and while : Haml provides far more tools than those presented here. Check out the reference documentation for full details. Contributions are welcomed, but before you get started please read the guidelines. At this point rake should run without error or warning and you are ready to start working on your patch! Haml currently supports Ruby 3.2.0 and higher, so please make sure your changes run on 3.2+. Haml was created by Hampton Catlin, the author of the original implementation. Hampton is no longer involved in day-to-day coding, but still consults on language issues. Natalie Weizenbaum was for many years the primary developer and architect of the "modern" Ruby implementation of Haml. Norman Clarke was the primary maintainer of Haml from 2012 to 2016.
Excerpt from the source-code README · 6,145 chars · not written by Vinony
~6 min read
Haml (HTML Abstraction Markup Language) is a templating system that is designed to avoid writing inline code in a web document and make the HTML cleaner. Similar to other template systems like eRuby, Haml also embeds some code that gets executed during runtime and generates HTML code in order to provide some dynamic content. In order to run Haml code, files need to have a extension. These files are similar to .erb or .eRuby files, which also help embed Ruby code while developing a web application.
While parsing code comments, Haml uses the same rules as Ruby 1.9 or later. Haml understands only ASCII-compatible encodings, like UTF-8, but not UTF-16, or UTF-32, because these are not compatible with ASCII.
via Wikidata · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).