BSD-3-Clause licensed by Justus Adam
Maintained by [email protected]
This version can be pinned in stack with:mustache-1.0.2@sha256:e2baa5cfc0f86b8a7eb528644d10dfd171550f570c8d430883c0bd9f7b046b3b,3691

mustache Travis Status Hackage Join the chat at https://gitter.im/JustusAdam/mustache

Haskell implementation of mustache templates.

Implements the official specs version 1.1.3

Motivation

The old Haskell implementation of mustache templates hastache seemed pretty abandoned to me. This implementation aims to be much easier to use and (fingers crossed) better maintained.

Since it is so easy to use and requires but a few files of code, I’ve also written a small executable that compiles and renders mustache templates with data input from json or yaml files.

Usage

Library

Please refer to the documentation on hackage.

Executable haskell-mustache

$ haskell-mustache --help
Simple mustache template substitution

arguments [OPTIONS] TEMPLATE [DATA-FILES]

Common flags:
  -t --templatedirs[=DIRECTORY]  The directory in which to search for the
                                 templates
  -? --help                      Display help message
  -V --version                   Print version information

Current implementation substitutes the TEMPLATE once with each DATA-FILE

Roadmap

  • [x] String parser for mustache templates
  • [x] Template substitution
  • [x] Standalone executable
  • [x] Support for ‘set delimiter’
  • [x] More efficiency using Text rather than String
  • [x] More efficient Text parsing
  • [x] Test coverage provided via the official specs
  • [x] Haddock documentation
  • [ ] More instances for ToMustache typeclass

Changes

Mustache library changelog

v0.5.1.0rc-7

  • Removed dependency tagsoup
  • Added ToMustache instances for some numbers

v0.5.0.0rc-6

  • Removed any dependency on ghc 7.10-type OverlappingInstances
  • Resolved String/List overlapping instances

v0.4.0.1rc-5

  • Added a necessary OVERLAPPABLE pragma

v0.4.0.0rc-4 (current stable version)

  • Removed conversion and conversion-text dependency.
  • Subsequently removed any dependency on overlapping instances
  • Readded support for ghc version 7.8
  • Removed Char -> Value instance of ToMustache (because of overlap)
  • Renamed AST

v0.3.1.0rc-3

  • Added infix precedence to conversion operators
  • Added INLINEABLE pragma to conversion functions

v0.3.0.1rc-2

Dropped GHC 7.8 support in favor of efficient and easy data conversion.

v0.3.0.0rc-1

  • improved documentation
  • fixed a bug with scope
  • small interface changes