mustache-haskell alternatives and similar packages
Based on the "Text" category.
Alternatively, view mustache-haskell alternatives based on common mentions on social networks and blogs.
-
pandoc-citeproc
Library and executable for using citeproc with pandoc -
scholdoc
Fork of Pandoc for the implementation of a ScholarlyMarkdown parser -
prettyprinter
A modern, extensible and well-documented prettyprinter. -
blaze-from-html
A blazingly fast HTML combinator library for Haskell. -
skylighting
A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions -
commonmark
Pure Haskell commonmark parsing library, designed to be flexible and extensible -
regex-genex
Given a list of regexes, generate all possible strings that matches all of them. -
text-offset
Emits code crossreference data for Haskell sources. -
regex-applicative
Regex-based parsing with an applicative interface -
pandoc-csv2table
A Pandoc filter that renders CSV as Pandoc Markdown Tables. -
pretty-show
Tools for working with derived Show instances in Haskell. -
servant-checked-exceptions
type-level errors for Servant APIs. -
double-conversion
A fast Haskell library for converting between double precision floating point numbers and text strings. It is implemented as a binding to the V8-derived C++ double-conversion library. -
text-format
A Haskell text formatting library optimized for ease of use and high performance. -
diagrams-pandoc
A pandoc filter to express diagrams inline using the haskell EDSL diagrams. -
boxes
A pretty-printing library for laying out text in two dimensions, using a simple box model. -
ghc-syntax-highlighter
Syntax highlighter for Haskell using the lexer of GHC
Static code analysis for 29 languages.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of mustache-haskell or a related project?
README
mustache-haskell
A Haskell implementation of mustache templates. Expects input data to be JSON.
Should be compatible with the the mustache specification. Except lambdas are not supported.
Supported syntax:
- basic variables
- sections
- inverted sections
- comments (are suppressed)
- partials
- set delimiter
This project currently only provides a command line interface. Later versions will provide a library API for templating ToJSON instances.
Install
You need the Haskell platform on your system.
cabal install mustache-haskell
Or alternatively
git clone [email protected]:danchoi/mustache-haskell.git
cd mustache-haskell
cabal sandbox init
cabal install
# Now copy .cabal-sandbox/bin/mus to your PATH
Usage
mus template.mustache < input.json
mus
Usage: mus [-c] [-d TEMPLATE_DIRECTORY] TEMPLATE_FILE
A Haskell implementation of Mustache templates. On STDIN provide the JSON to
insert into the template.
Available options:
-h,--help Show this help text
-c Just output parse tree of template file
-d TEMPLATE_DIRECTORY Template directory
List separator syntax
mustache-haskell adds one additional feature to the mustache specification. If you are outputing elements of a list, you can designate an optional list separator with the following syntax:
{{#hobbies, }}{{name}}{{/hobbies}}
This designates ", "
as the list separator and will output
sewing, brewing, cooking
when the input is
{"hobbies":[{"name":"sewing"},{"name":"brewing"},{"name":"cooking"}]}
Performance
In a few informal tests,
mus template.mustache < input.json
is about 10x faster than the Ruby mustache gem command-line implementation,
mustache - template.mustache < input.json
Related projects
- whiskers Mustache templates with Template Haskell (reddit)
- hastache Haskell implementation of Mustache templates
- mustache2hs takes in Haskell records (single data constructor only) and a list of mustache template and record name pairs, and generates Haskell code for functions that take an escape function and one of the records
- mustache.go an implementation of the mustache template language in Go