hamplify
is a lightweight HAML-ish compiler written in Python.
Here are some reasons to use hamplify
:
Install hamplify
with pip:
pip install hamplify
Use the hamplify
command to compile your templates:
hamplify <input-dir> <output-dir> [--watch]
Install the test dependencies
pip install -r reqs/test.txt
Run the tests
pytest --cov=hamplify
!!!
%html
%head
%title
- block title
My Site
%link(rel="stylesheet" href="style.css")
:css
p {
background-color: #CCC;
}
%body
-# This is an HTML comment
/ This is another comment,
but it won't be rendered
.container
%p A paragraph with some text.
%button.btn#my-button A button
%a(href='#')= the_link|some_filter
:plain
This is a plaintext block. The compiler will not parse anything in here.
:javascript
console.log("Hello, world!");