https://github.com/haml/haml
HTML Abstraction Markup Language - A Markup Haiku
https://github.com/haml/haml
Keywords from Contributors
activerecord activejob mvc rack rubygem sinatra rspec crash-reporting ruby-gem rubocop
Last synced: about 1 hour ago
JSON representation
Repository metadata
HTML Abstraction Markup Language - A Markup Haiku
- Host: GitHub
- URL: https://github.com/haml/haml
- Owner: haml
- License: mit
- Created: 2008-02-11T22:55:26.000Z (about 18 years ago)
- Default Branch: main
- Last Pushed: 2026-01-13T19:11:14.000Z (4 months ago)
- Last Synced: 2026-04-28T23:30:21.826Z (2 days ago)
- Language: Ruby
- Homepage: http://haml.info
- Size: 10.2 MB
- Stars: 3,844
- Watchers: 74
- Forks: 582
- Open Issues: 14
- Releases: 36
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: MIT-LICENSE
README.md
Haml
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.
Basic Usage
Haml can be used from the command line or as part of a Ruby web framework. The
first step is to install the gem:
gem install haml
After you write some Haml, you can run
haml render document.haml
to compile it to HTML. For more information on these commands, check out
haml --help
To use Haml programmatically, check out the YARD documentation.
Using Haml with Rails
To use Haml with Rails, simply add Haml to your Gemfile and run bundle.
gem 'haml'
If you'd like to replace Rails's ERB-based generators with Haml, add
haml-rails to your Gemfile as well.
Formatting
The most basic element of Haml is a shorthand for creating HTML:
%tagname{:attr1 => 'value1', :attr2 => 'value2'} Contents
No end-tag is needed; Haml handles that automatically. If you prefer HTML-style
attributes, you can also use:
%tagname(attr1='value1' attr2='value2') Contents
Adding class and id attributes is even easier. Haml uses the same syntax as
the CSS that styles the document:
%tagname#id.class
In fact, when you're using the <div> tag, it becomes even easier. Because
<div> is such a common element, a tag without a name defaults to a div. So
#foo Hello!
becomes
<div id='foo'>Hello!</div>
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:
%ul
%li Salt
%li Pepper
becomes:
<ul>
<li>Salt</li>
<li>Pepper</li>
</ul>
You can also put plain text as a child of an element:
%p
Hello,
World!
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:
%p
Date/Time:
- now = DateTime.now
%strong= now
- if now > DateTime.parse("December 31, 2006")
= "Happy new " + "year!"
Haml provides far more tools than those presented here. Check out the reference
documentation
for full details.
Indentation
Haml's indentation can be made up of one or more tabs or spaces. However,
indentation must be consistent within a given document. Hard tabs and spaces
can't be mixed, and the same number of tabs or spaces must be used throughout.
Contributing
Contributions are welcomed, but before you get started please read the
guidelines.
After forking and then cloning the repo locally, install Bundler and then use it
to install the development gem dependencies:
gem install bundler
bundle install
Once this is complete, you should be able to run the test suite:
rake
At this point rake should run without error or warning and you are ready to
start working on your patch!
Note that you can also run just one test out of the test suite if you're working
on a specific area:
ruby -Itest test/helper_test.rb -n test_buffer_access
Haml currently supports Ruby 3.2.0 and higher, so please make sure your changes run on 3.2+.
Team
Current Maintainers
Alumni
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.
License
Some of Natalie's work on Haml was supported by Unspace Interactive.
Beyond that, the implementation is licensed under the MIT License.
Copyright (c) 2006-2019 Hampton Catlin, Natalie Weizenbaum and the Haml team
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Owner metadata
- Name: Haml
- Login: haml
- Email:
- Kind: organization
- Description:
- Website: http://haml.info
- Location:
- Twitter: HamlHTML
- Company:
- Icon url: https://avatars.githubusercontent.com/u/1686160?v=4
- Repositories: 7
- Last ynced at: 2025-10-30T11:45:55.196Z
- Profile URL: https://github.com/haml
GitHub Events
Total
- Release event: 1
- Pull request event: 11
- Fork event: 10
- Issues event: 18
- Watch event: 79
- Issue comment event: 23
- Push event: 18
- Pull request review event: 6
Last Year
- Release event: 1
- Pull request event: 3
- Fork event: 4
- Issues event: 9
- Watch event: 51
- Issue comment event: 4
- Push event: 15
- Pull request review event: 6
Committers metadata
Last synced: 2 days ago
Total Commits: 5,799
Total Committers: 226
Avg Commits per committer: 25.659
Development Distribution Score (DDS): 0.514
Commits in past year: 35
Committers in past year: 11
Avg Commits per committer in past year: 3.182
Development Distribution Score (DDS) in past year: 0.457
| Name | Commits | |
|---|---|---|
| Nathan Weizenbaum | n****2@g****m | 2816 |
| Takashi Kokubun | t****n@g****m | 1305 |
| Norman Clarke | n****n@n****m | 367 |
| Akira Matsuda | r****e@d****p | 210 |
| Takashi Kokubun | t****n@c****m | 191 |
| Matt Wildig | m****t@m****k | 162 |
| Chris Eppstein | c****s@e****t | 130 |
| Tee Parham | t****e@n****m | 92 |
| hcatlin | h****n@7****9 | 77 |
| Mislav Marohnić | m****c@g****m | 27 |
| packagethief | p****f@7****9 | 20 |
| thedarkone | t****2@g****m | 17 |
| Hampton Catlin | h****n@g****m | 17 |
| tom | t****m@7****9 | 15 |
| Geremia Taglialatela | t****a | 10 |
| Chris Heald | c****d@g****m | 10 |
| Ali Ismayilov | a****i@i****o | 10 |
| Robin Daugherty | r****n@r****t | 9 |
| Hampton Catlin | h****n@v****m | 9 |
| Nick Sutterer | a****k@g****m | 7 |
| Dillon Welch | d****8@g****m | 6 |
| Jon Allured | j****d@g****m | 6 |
| Joshua Peek | j****h@j****m | 6 |
| Koszta Peter Pal | k****l@e****u | 5 |
| Aman Gupta | a****n@t****t | 5 |
| Andre Arko | a****e@a****t | 4 |
| Cristi Balan | e****l@c****u | 4 |
| Jared Beck | j****d@j****m | 4 |
| Jonathan del Strother | me@d****m | 4 |
| Peter Goldstein | p****n@g****m | 4 |
| and 196 more... | ||
Committer domains:
- pivotallabs.com: 3
- me.com: 3
- sanityinc.com: 1
- orange.fr: 1
- schilling.io: 1
- wincent.com: 1
- barzel.org: 1
- shaneriley.com: 1
- bamaru.de: 1
- woodenbits.com: 1
- asquera.de: 1
- jan.vlnas.cz: 1
- risingsuntech.net: 1
- tanda.co: 1
- fixieconsulting.com: 1
- redopop.com: 1
- ulbrich-boerwang.de: 1
- samedi.de: 1
- prevailhs.com: 1
- fortnightlabs.com: 1
- ombushop.com: 1
- threepillarglobal.com: 1
- tictocfamily.com: 1
- sqreen.io: 1
- red.(none): 1
- hester.(none): 1
- njclarke.com: 1
- dio.jp: 1
- cookpad.com: 1
- mattwildig.co.uk: 1
- eppsteins.net: 1
- neighborland.com: 1
- ismailov.info: 1
- robindaugherty.net: 1
- veuelive.com: 1
- joshpeek.com: 1
- ehok.u-szeged.hu: 1
- tmm1.net: 1
- arko.net: 1
- che.lu: 1
- jaredbeck.com: 1
- delstrother.com: 1
- jeremyevans.net: 1
- hypothetical.com.au: 1
- thoughtworks.com: 1
- sampohlenz.com: 1
- creasty.com: 1
- evilmartians.com: 1
- optoro.com: 1
- darbysmart.com: 1
- notesake.com: 1
- kickstarter.com: 1
- schito.me: 1
- 4angle.com: 1
- dara-abrams.com: 1
- donaldbuchanan.com: 1
- arnfield.com: 1
- caih.org: 1
- corinlangosch.com: 1
- lixo.org: 1
- theaboutbox.com: 1
- brynary.com: 1
- madriska.com: 1
- atg.auto: 1
- machu.jp: 1
- tigerlilyapps.com: 1
- comcast.net: 1
- svyatov.ru: 1
- lackac.hu: 1
- lannbox.com: 1
- thinkpixellab.com: 1
- eljojo.net: 1
- suse.de: 1
- thegarvin.com: 1
- ualberta.ca: 1
- jaredmoody.com: 1
- deadlyicon.com: 1
- yandex.ru: 1
- unwwwired.net: 1
- azure.monochrome: 1
- schooladmin.com: 1
- causes.com: 1
- trms.com: 1
- sebjacobs.com: 1
- idiomdrottning.org: 1
- edgeofthenet.org: 1
- paulbarry.com: 1
- annesley.cc: 1
- dievision.de: 1
- braingourmets.com: 1
- hagenburger.net: 1
- nickhammond.com: 1
- risen.be: 1
- novemberain.com: 1
- mike.is: 1
- ntk.me: 1
- espians.com: 1
- red56.uk: 1
- spork.in: 1
- sunfox.org: 1
- karekinian.com: 1
- mccreight.com: 1
- ping.de: 1
- cpan.org: 1
Issue and Pull Request metadata
Last synced: 17 days ago
Total issues: 103
Total pull requests: 66
Average time to close issues: 9 months
Average time to close pull requests: about 1 month
Total issue authors: 85
Total pull request authors: 29
Average comments per issue: 2.65
Average comments per pull request: 1.02
Merged pull request: 39
Bot issues: 0
Bot pull requests: 0
Past year issues: 6
Past year pull requests: 12
Past year average time to close issues: about 1 month
Past year average time to close pull requests: 1 day
Past year issue authors: 6
Past year pull request authors: 7
Past year average comments per issue: 0.5
Past year average comments per pull request: 0.0
Past year merged pull request: 6
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- HamptonMakes (8)
- tagliala (6)
- mildred (3)
- abitrolly (2)
- k0kubun (2)
- timdiggins (2)
- mockdeep (2)
- jibees (1)
- mishina2228 (1)
- Frigory33 (1)
- niklas-hasselmeyer (1)
- maland (1)
- AkshayGoyal022 (1)
- minad (1)
- mattwildig (1)
Top Pull Request Authors
- tagliala (17)
- k0kubun (8)
- leo424y (4)
- nhasselmeyer (4)
- JasonnnW3000 (2)
- mingan (2)
- petergoldstein (2)
- Frigory33 (2)
- mattwildig (2)
- snan (2)
- amatsuda (2)
- danieldiekmeier (2)
- jdelStrother (1)
- iazel (1)
- risen (1)
Top Issue Labels
- Help Wanted (4)
- Bug (3)
- Feature (3)
- Feedback (1)
Top Pull Request Labels
Package metadata
- Total packages: 5
-
Total downloads:
- rubygems: 391,057,442 total
- Total docker downloads: 934,513,986
- Total dependent packages: 1,475 (may contain duplicates)
- Total dependent repositories: 122,605 (may contain duplicates)
- Total versions: 460
- Total maintainers: 5
- Total advisories: 1
gem.coop: haml
An elegant, structured (X)HTML/XML templating engine.
- Homepage: https://haml.info
- Documentation: http://www.rubydoc.info/gems/haml/
- Licenses: MIT
- Latest release: 7.2.0 (published 4 months ago)
- Last Synced: 2026-04-28T23:28:07.629Z (2 days ago)
- Versions: 208
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 195,510,593 Total
- Docker Downloads: 467,256,993
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.088%
- Downloads: 0.128%
- Docker downloads count: 0.223%
- Maintainers (5)
rubygems.org: haml
An elegant, structured (X)HTML/XML templating engine.
- Homepage: https://haml.info
- Documentation: http://www.rubydoc.info/gems/haml/
- Licenses: MIT
- Latest release: 7.2.0 (published 4 months ago)
- Last Synced: 2026-04-29T09:43:47.590Z (1 day ago)
- Versions: 208
- Dependent Packages: 1,475
- Dependent Repositories: 122,605
- Downloads: 195,541,383 Total
- Docker Downloads: 467,256,993
-
Rankings:
- Dependent packages count: 0.034%
- Dependent repos count: 0.109%
- Downloads: 0.12%
- Average: 0.306%
- Docker downloads count: 0.313%
- Stargazers count: 0.347%
- Forks count: 0.914%
- Maintainers (5)
- Advisories:
proxy.golang.org: github.com/haml/haml
- Homepage:
- Documentation: https://pkg.go.dev/github.com/haml/haml#section-documentation
- Licenses: mit
- Latest release: v7.2.0+incompatible (published 4 months ago)
- Last Synced: 2026-04-28T23:28:09.286Z (2 days ago)
- Versions: 42
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.497%
- Average: 5.681%
- Dependent repos count: 5.866%
gem.coop: haml-parser
Pladeholder for future haml-parser
- Homepage: https://github.com/haml/haml
- Documentation: http://www.rubydoc.info/gems/haml-parser/
- Licenses: MIT
- Latest release: 0.0.0 (published about 8 years ago)
- Last Synced: 2026-04-25T17:03:57.988Z (5 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 2,731 Total
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 30.189%
- Downloads: 90.568%
- Maintainers (1)
rubygems.org: haml-parser
Pladeholder for future haml-parser
- Homepage: https://github.com/haml/haml
- Documentation: http://www.rubydoc.info/gems/haml-parser/
- Licenses: MIT
- Latest release: 0.0.0 (published about 8 years ago)
- Last Synced: 2026-04-28T23:28:07.648Z (2 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 2,735 Total
-
Rankings:
- Stargazers count: 0.293%
- Forks count: 0.848%
- Dependent packages count: 15.706%
- Average: 31.479%
- Dependent repos count: 46.782%
- Downloads: 93.765%
- Maintainers (1)
Dependencies
- actions/checkout v3 composite
- ruby/setup-ruby v1 composite
- benchmark-ips = 2.3.0
- maxitest >= 0
- pandoc-ruby >= 0
- pry >= 0
- redcarpet >= 0
- stackprof >= 0
- benchmark_driver >= 0 development
- bundler >= 0 development
- coffee-script >= 0 development
- erubi >= 0 development
- haml >= 5 development
- less >= 0 development
- minitest-reporters ~> 1.1 development
- rails >= 4.0 development
- rake >= 0 development
- rake-compiler >= 0 development
- sass >= 0 development
- slim >= 0 development
- string_template >= 0 development
- unindent >= 0 development
- temple >= 0.8.2
- thor >= 0
- tilt >= 0
Score: 34.6836431630073