mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
HTML Abstraction Markup Language - A Markup Haiku
benchmarks | ||
bin | ||
lib | ||
spec | ||
.gitignore | ||
.rspec | ||
.travis.yml | ||
Gemfile | ||
hamlit.gemspec | ||
LICENSE.txt | ||
Rakefile | ||
README.md |
Hamlit 
Hamlit is a high performance haml implementation.
Installation
Add this line to your application's Gemfile:
gem 'hamlit'
or just replace gem "haml"
with gem "hamlit"
.
Features
Fast rendering
Hamlit's rendering is 8.47x times faster than original haml.
hamlit: 133922.9 i/s
erubis: 123464.1 i/s - 1.08x slower
slim: 110404.3 i/s - 1.21x slower
faml: 92009.3 i/s - 1.46x slower
haml: 15810.4 i/s - 8.47x slower
This benchmark is the same as slim-template/slim's one for fairness. (The result on travis CI)
Better parser
Haml's attribute parser is not so good. For example, raises syntax error for %a{ b: '}' }
.
Hamlit's attribute parser is implemented with Ripper, which is an official lexer for Ruby,
so it can able to parse such an attribute.
Passing haml-spec
haml/haml-spec is a basic suite of tests for Haml interpreters. For all test cases in haml-spec, Hamlit behaves the same as Haml (ugly mode only, which is used on production).
License
MIT License