Maintainer's Corner

Readme for microstache-1.0.1.1

microstache

Based on stache library, which uses megaparsec.
This library uses parsec, thus the name: microstache.

This is a Haskell implementation of Mustache templates. The implementation
conforms to the version 1.1.3 of official [Mustache specification]
(https://github.com/mustache/spec). It is extremely simple and
straightforward to use with minimal but complete API — three functions to
compile templates (from directory, from file, and from lazy text) and one to
render them.

For rendering you only need to create Aeson's Value where you put the data
to interpolate. Since the library re-uses Aeson's instances and most data
types in Haskell ecosystem are instances of classes like
Data.Aeson.ToJSON, the whole process is very simple for end user.

One feature that is not currently supported is lambdas. The feature is
marked as optional in the spec and can be emulated via processing of parsed
template representation. The decision to drop lambdas is intentional, for
the sake of simplicity and better integration with Aeson.

Differences from stache

Instead of megaparsec, parsec is used. Error message quality is most likely degraded.