ginger

{{ "HTML Templates For Humans" }}

Latest release: 0.9.0.0

Ginger is a template language for HTML.

Its main inspiration is Jinja2, a popular template language for Python, used in frameworks like Flask. Similar template engines have been implemented in other languages, such as PHP’s Twig. Ginger does the same for Haskell, adding a few things that are possible because of Haskell’s type system.

Main features:

  • DOM-agnostic: Ginger doesn’t know anything about the HTML DOM; as far as we are concerned, HTML source is just a stream of bytes, and all we know is how to encode data as HTML and how to glue snippets of HTML together.
  • HTML superset-ish: Ginger is (almost) a superset of HTML. This means that a valid Ginger template is (almost) a valid HTML document.
  • Mostly Jinja-compatible: Ginger aims to be template-compatible with Jinja, but sacrificing the bits that don’t make sense in a Haskell host application.
  • Sandboxable: Ginger is designed such that it can only ever touch things that the host application explicitly exposes.

Documentation

User Guide

A guided introduction to Ginger and its template syntax.

If you want to learn how to write Ginger templates, this is the place to look.

API Reference

API reference on Hackage. Useful if you want to use Ginger in your Haskell projects.

Code

Git Repositories

Ginger on GitHub

Ginger on Bitbucket

Haskell Packages

Current release on Hackage

Ginger For JavaScript

Some experimental work has been done to compile Ginger into a JavaScript module:

Ginger-JS on GitHub