<commit_before>[![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/) parser written in Python.

Here are some reasons to use `hamplify`:

- **Template Support**: Included support for Django and Jinja2 templates
- **Compatibility**: Works with Python 2.7 and 3.3+
- **Lightweight**: Requires no dependencies and is framework agnostic
- **Smaller Templates**: Excess whitespace from templates is automatically removed
- **Painless**: Integrates seamlessly into existing projects

## Using hamplify

Install `hamplify` with pip:
```
pip install hamplify
```

Use the `hamplify` command to compile your templates:
```
hamplify <input-dir> <output-dir> [--watch]
```

## Running Tests
Install the test dependencies 
```
pip install -r reqs/test.txt
```

Run the tests 
```
pytest --cov=hamplify
```<commit_msg>Added a syntax sample to the README<commit_after>[![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`:

- **Template Support**: Included support for Django and Jinja2 templates
- **Compatibility**: Works with Python 2.7 and 3.3+
- **Lightweight**: Requires no dependencies and is framework agnostic
- **Smaller Templates**: Excess whitespace from templates is automatically removed
- **Painless**: Integrates seamlessly into existing projects

## Using hamplify

Install `hamplify` with pip:
```
pip install hamplify
```

Use the `hamplify` command to compile your templates:
```
hamplify <input-dir> <output-dir> [--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

      :plain
        This is a plaintext block. The compiler will not parse anything in here.

    :javascript
      console.log("Hello, world!");
```
{'fraction_non_alphanumeric': 0.14319566689234936, 'fraction_numerical': 0.003385240352064997, 'mean_word_length': 4.193321616871705, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4565779', 'n_tokens_mistral': 1004, 'n_tokens_neox': 921, 'n_words': 260}