https://github.com/justusadam/mustache
Haskell implementation of mustache templates
https://github.com/justusadam/mustache
haskell mustache-templates template-language
Last synced: 3 months ago
JSON representation
Haskell implementation of mustache templates
- Host: GitHub
- URL: https://github.com/justusadam/mustache
- Owner: JustusAdam
- License: bsd-3-clause
- Created: 2015-09-05T19:45:48.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-07-21T15:18:27.000Z (almost 2 years ago)
- Last Synced: 2025-03-29T20:09:55.499Z (4 months ago)
- Topics: haskell, mustache-templates, template-language
- Language: Haskell
- Homepage:
- Size: 247 KB
- Stars: 98
- Watchers: 5
- Forks: 33
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# mustache [](https://travis-ci.org/JustusAdam/mustache) [](https://hackage.haskell.org/package/mustache) [](https://gitter.im/JustusAdam/mustache?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Haskell implementation of [mustache templates][mustache-homepage].
[mustache-homepage]: https://mustache.github.io
Implements the official [specs version 1.1.3](https://github.com/mustache/spec/releases/tag/v1.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.
[hastache]: https://hackage.haskell.org/package/hastache
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.
[documentation]: https://hackage.haskell.org/package/mustache
### Executable `haskell-mustache`
$ haskell-mustache --help
Simple mustache template substitutionarguments [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 informationCurrent implementation substitutes the `TEMPLATE` once with each `DATA-FILE`
#### Example
$ haskell-mustache my-template-file data-file-1.json data-file-2.json data-file-3.json
## 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](https://github.com/mustache/spec)
- [x] Haddock documentation
- [ ] More instances for `ToMustache` typeclass