An Elm library for Mustache templates.
Currently, this library support attempts limited support for version 1.4.3 of the Mustache Spec.
{{ name }}){{# show }} or {{^ hide }}){{ characters }} renders Abbot & Costello){{{ characters }}} or {{& characters }}){{! comment }}){{=<% %>=}}){{.}})import Mustache
template : String
template =
"Hi, my name is {{ name }}.{{# show }} Show me!{{/ show }}"
evaluatedTemplate : Maybe String
evaluatedTemplate =
Mustache.render
[ Mustache.Variable "name" "D'Angelo"
, Mustache.Section "show" True
]
template
evaluatedTemplate --> Just "Hi, my name is D'Angelo. Show me!"