https://github.com/kangaroux/hamplify
HAML-ish template compiler written in Python
https://github.com/kangaroux/hamplify
converter django flask haml haml-ish html jinja2 parser python template
Last synced: 5 months ago
JSON representation
HAML-ish template compiler written in Python
- Host: GitHub
- URL: https://github.com/kangaroux/hamplify
- Owner: Kangaroux
- License: mit
- Created: 2017-02-14T03:34:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-23T19:18:34.000Z (over 8 years ago)
- Last Synced: 2025-02-22T01:35:56.338Z (over 1 year ago)
- Topics: converter, django, flask, haml, haml-ish, html, jinja2, parser, python, template
- Language: Python
- Homepage:
- Size: 76.2 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/Kangaroux/hamplify)
[](https://coveralls.io/github/Kangaroux/hamplify?branch=master)
[](https://badge.fury.io/py/hamplify)
# hamplify
`hamplify` is a lightweight [HAML-ish](http://haml.info/) compiler written in Python.
Here are some reasons to use `hamplify`:
- Compatible with Python 2.7 and 3.3+
- Requires **NO** dependencies and is framework agnostic
- Support for Django and Jinja2 templates
- Templates are automatically minified
- Integrates seamlessly into existing projects
## Using hamplify
Install `hamplify` with pip:
```
pip install hamplify
```
Use the `hamplify` command to compile your templates:
```
hamplify [--watch]
```
## Running Tests
Install the test dependencies
```
pip install -r reqs/test.txt
```
Run the tests
```
pytest --cov=hamplify
```
## Syntax Sample
```HAML
!!!
%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!");
```