mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Update README.md
This commit is contained in:
parent
6d7d5ca760
commit
1a9790b501
1 changed files with 38 additions and 1 deletions
39
README.md
39
README.md
|
@ -1,6 +1,43 @@
|
|||
# Hamlit [![wercker status](https://app.wercker.com/status/363b10d161203c26517faa3a9a329ed8/s "wercker status")](https://app.wercker.com/project/bykey/363b10d161203c26517faa3a9a329ed8)
|
||||
|
||||
Yet another haml implementation
|
||||
Hamlit is a high performance [haml](https://github.com/haml/haml) implementation.
|
||||
|
||||
## Installation
|
||||
|
||||
Add this line to your application's Gemfile:
|
||||
|
||||
```ruby
|
||||
gem 'hamlit'
|
||||
```
|
||||
|
||||
or just replace `gem "haml"` with `gem "hamlit"`.
|
||||
|
||||
## Features
|
||||
### Fast rendering
|
||||
|
||||
Hamlit's rendering is **7.0x times faster** than original haml.
|
||||
|
||||
```
|
||||
hamlit: 94047.0 i/s
|
||||
erubis: 87136.3 i/s - 1.08x slower
|
||||
slim: 83996.0 i/s - 1.12x slower
|
||||
faml: 68861.1 i/s - 1.37x slower
|
||||
haml: 13428.6 i/s - 7.00x slower
|
||||
```
|
||||
|
||||
[This benchmark](https://github.com/k0kubun/hamlit/blob/6d7d5ca7601dad9fe04d67621255ac2a69cd8d85/benchmarks/benchmark.rb)
|
||||
is the same as [slim-template/slim](https://github.com/slim-template/slim)'s one for fairness.
|
||||
|
||||
### 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](https://github.com/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
|
||||
|
||||
|
|
Loading…
Reference in a new issue