Haskell implementation of mustache templates.
Implements the official specs version 1.1.3
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.
Please refer to the documentation on hackage.
$ 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
$ haskell-mustache my-template-file data-file-1.json data-file-2.json data-file-3.json
- [x] String parser for mustache templates
- [x] Template substitution
- [x] Standalone executable
- [x] Support for ‘set delimiter’
- [x] More efficiency using
- [x] More efficient Text parsing
- [x] Test coverage provided via the official specs
- [x] Haddock documentation
- [ ] More instances for
Mustache library changelog
getFilefrom public API
- Quick fix to prevent catchSubstitute from reporting substitutions to the renderer.
- Added a function to catch a substitution result
- Quickfix for an issue with resolving in context
- changed substitution into a new monad
- easier usage in lambdas and lambdas can now do nested substitution
- Treat Null as falsy in sections
- Added excaping for the apostrophe “’” as per xml spec, courtesy to @tfausak
- Fixed template cache again, as the spec requires access to the previous cache in partials as well
- Fixed an error where the substitution of partials would not use the template cache of the new partial
- Added API preserving checked substitution with ‘checkedSubstitute’ and ‘checkedSubstituteValue’
- Better and more ToMustache instances. No longer are all sequences of characters serialised as strings
- Added QuasiQuotes and template Haskell functions for compile time template embedding.
- Stabilised API’s
- Removed dependency tagsoup
- Added ToMustache instances for some numbers
- Removed any dependency on ghc 7.10-type OverlappingInstances
- Resolved String/List overlapping instances
- Added a necessary OVERLAPPABLE pragma
v0.4.0.0rc-4 (current stable version)
- Subsequently removed any dependency on overlapping instances
- Readded support for ghc version 7.8
Char -> Valueinstance of
ToMustache(because of overlap)
- Added infix precedence to conversion operators
INLINEABLEpragma to conversion functions
Dropped GHC 7.8 support in favor of efficient and easy data conversion.
- improved documentation
- fixed a bug with scope
- small interface changes