# Haml

> HTML templating engine for Ruby with indentation-based, end-tag-free markup

Source: https://talira.ai/catalog/haml-ceka8d0g
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library, Command-line tool
- Categories: [libraries / templating](https://talira.ai/categories/libraries/templating), [languages / ruby / rails](https://talira.ai/categories/languages/ruby/rails)
- Platforms: linux, macos, windows, cli
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Pricing notes: Free and open source under the MIT licence.
- Free tier: yes[^1]
- Self-hostable: no
- Backed by: [The Haml Team](https://talira.ai/orgs/haml.md)

Haml (HTML Abstraction Markup Language) is a templating engine for Ruby that replaces ERB's HTML-with-tags with a terser, indentation-based syntax. Elements are written as `%tag`, ids and classes use CSS-style `#id.class` shorthand with `div` as the default, nesting comes from indentation, and closing tags are added for you, while `=` and `-` lines run Ruby. It works in [Ruby on Rails](https://talira.ai/catalog/ruby-on-rails-xkdcpj5k.md) by adding the gem, with haml-rails switching Rails' generators to Haml, in other Ruby frameworks, and from the command line with `haml render`. It is MIT licensed and maintained by the Haml team.

## Links

- Website: https://haml.info/
- GitHub: https://github.com/haml/haml
- Docs: https://haml.info/docs/yardoc/file.REFERENCE.html

## Problems it solves

- write Rails views without closing HTML tags and noisy ERB
- a cleaner, indentation-based alternative to ERB templates
- make Rails generators create Haml views instead of ERB
- compile a template file to HTML from the command line

## Features

- indentation-based markup with automatic closing tags
- %tag syntax with CSS-style #id and .class shorthand; div is the default tag
- Ruby-style hash or HTML-style attributes
- embedded Ruby with = for output and - for logic
- Rails support by adding the gem; haml-rails replaces ERB generators
- haml render command-line tool to compile templates to HTML

## Limitations

- Ruby only: Haml templates need a Ruby runtime to compile

## Capabilities

- Has a command line tool: plan not known

## Trust

Overall: 0.32 out of 1.
Signals: backing 0.30, extensibility 0.20.

- backed by The Haml Team

Warnings:

- GitHub activity not fetched yet

## Alternatives

- [Liquid](https://talira.ai/catalog/liquid-97qqwka5.md): Safe, customer facing template language for flexible web apps

## Sources

[^1]: https://github.com/haml/haml/blob/main/MIT-LICENSE (checked 22 Nov 2026)
