Software

Haml – indentation-based HTML templating language

Haml is a markup and templating language for describing HTML documents using compact, indentation-based syntax.

Instead of writing conventional HTML opening and closing tags, authors describe elements and their nesting through a combination of short identifiers and whitespace. This makes the hierarchy of a template apparent from its layout.

Haml was designed as an alternative to inline templating systems such as ERB. It allows HTML structures and dynamic expressions to coexist without surrounding every element with repetitive markup.

The language follows conventions familiar from CSS selectors. Classes and IDs can be expressed using shorthand syntax, while more complex attributes can be specified separately.

Indentation is significant in Haml. The nesting level of an element determines its position in the generated document, so consistent whitespace is essential when maintaining templates.

Haml also supports embedded expressions and control statements. These can supply dynamic content, conditionally render elements and generate repeated structures from application data.

Filters allow sections of a template to be processed as other kinds of content. This makes it possible to include stylesheets, scripts, plain text and markup handled by compatible external processors.

Haml can be used directly through its template engine or integrated into Ruby on Rails applications, where templates are generally identified by the .haml extension.

This is free and open source software.

Key Features

  • Indentation-based HTML document structure.
  • Compact syntax for tags and attributes.
  • CSS-style class and ID shorthand.
  • Dynamic expressions embedded in templates.
  • Conditional statements and iteration.
  • Attribute hashes and dynamic attribute values.
  • Escaped and unescaped expression output.
  • Whitespace preservation and removal controls.
  • Comments and comments omitted from generated output.
  • Filters for processing specialised content blocks.
  • Plain-text and escaped-text filters.
  • Integration with external markup processors through filters.
  • Standalone template rendering.
  • Ruby on Rails template integration.

Website: haml.info
Support:
Developer: Hampton Catlin, Natalie Weizenbaum and Takashi Kokubun
License: MIT License

Haml is written in Ruby. Learn Ruby with our recommended free books and free tutorials.


Related Software

Lightweight Markup Languages
MarkdownMarkup language and Text-to-HTML conversion tool
MultiMarkdownBased on Markdown with additional features
GitHub Flavored MarkdownFor user content on GitHub.com and GitHub Enterprise
Markdown ExtraLightweight markup language based on Markdown
AsciiDocPresentable text document format for writing articles
TextileBilled as a "humane web text generator"
TexyText-to-XHTML formatter and converter library
TomeMarkup Language and Tool Suite for Authors
reStructuredTextMarkup Syntax and Parser Component of Docutils
HamlTemplating engine for HTML
JsonMLMap between XML and JSON
TOMLTom’s Obvious Minimal Language
DjotLight markup language inspired by CommonMark
Org-modePlain text markup for notes, documents, and workflows

Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted