Hypertag. New language for HTML templating w/ Django support


A new language for document generation and HTML templating has been released. Inspired by indentation-based template languages (Slim, Haml, Shpaml), Hypertag (http://hypertag.io/) provides clean, readable syntax, and adds plenty of new features: native custom tags, DOM manipulation, Python-like imports, control blocks, expressions, and more. Multiple elements were carried over from the Python’s syntax to ensure ease of use. An example Hypertag script:

    li | Cat
    li | Dog
    li | Rabbit & Guinea pig

is rendered to:

    <li>Rabbit &amp; Guinea pig</li>

The example below contains a control block (for), chained tags (a, b, i) and an attribute (href):

h1 | Table of Contents
    for k in [1,2,3]:
        a href='#heading-{k}' : b : i | Heading no. $k

and is rendered to:

<h1>Table of Contents</h1>
    <a href="#heading-1"><b><i>Heading no. 1</i></b></a>
    <a href="#heading-2"><b><i>Heading no. 2</i></b></a>
    <a href="#heading-3"><b><i>Heading no. 3</i></b></a>

Hypertag can be called directly from Python code, or be plugged as a template backend into Django. Hypertag scripts can use all of Django’s filter functions.

Hypertag is a full-featured standalone language that is not limited to HTML alone and can generate different markups. See the Quick Start for more info. Install from PyPI as “hypertag-lang”.