Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 27 days 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 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-23T19:18:34.000Z (about 7 years ago)
- Last Synced: 2024-10-11T09:11:55.539Z (27 days 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
[![Build Status](https://travis-ci.org/Kangaroux/hamplify.svg?branch=master)](https://travis-ci.org/Kangaroux/hamplify)
[![Coverage Status](https://coveralls.io/repos/github/Kangaroux/hamplify/badge.svg?branch=master)](https://coveralls.io/github/Kangaroux/hamplify?branch=master)
[![PyPI version](https://badge.fury.io/py/hamplify.svg)](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!");
```