Haml-rs
This is a library and CLI for parsing Haml templates. You are able to get Haml-rs on Crates.io. The aim for this is to produce identical HTML to what the Ruby Haml gem produces.
Usage
To include haml-rs in your project add the following to your Cargo.toml:
[dependencies]
hamlrs = "0.3.0"
Then add the following to your code:
extern crate haml;
Example
Library
extern crate haml;
CLI
hamlrs input.haml output.html
Printing the AST
If you want to print out the AST that is generated for a given Haml file you can run the following command
hamlrs ast input.haml
Stability
This software is in its early stages and as such there may be issues with stability.
If you find any bugs please don't hesitate to open an issue on github or, if you want, you can reach out directly to me at jon@dontbreakthebuild.com
Integration tests
There are currently a few integration tests (and more to come). If you are going to contribute to an integration test please make sure that the HTML file that is generated by the Ruby Haml gem so that we can ensure that we are producing the same output as the reference implementation.
Current limitations
There is no variable/expression support in Haml-rs. This is something that is being thought about and if you want to add your thoughts you are more than welcome to comment here.
Roadmap
These are things that are on the roadmap for this project:
- Documentation
- Add variable support
- Support ruby attributes
- Add more tests
- Improve performance (there are areas that are copying when they may not need to)
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Haml-rs by you, shall be licensed as MIT, without any additional terms or conditions.
If you have any questions you can reach me via email at jon@dontbreakthebuild.com