Copyright | © 2016 Stack Buliders |
---|---|
License | BSD 3 clause |
Maintainer | Mark Karpov <markkarpov@openmailbox.org> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Types used by the package. You don't usually need to import the module, because Text.Mustache re-exports everything you may need, import that module instead.
- data Template = Template {
- templateActual :: PName
- templateCache :: Map PName [Node]
- data Node
- newtype Key = Key {}
- newtype PName = PName {}
- data MustacheException = MustacheException (ParseError Char Dec)
Documentation
Mustache template as name of “top-level” template and a collection of all available templates (partials).
Template
is a Semigroup
. This means that you can combine Template
s
(and their caches) using the (<>
) operator, the resulting Template
will have the same currently selected template as the left one. Union of
caches is also left-biased.
Template | |
|
Structural element of template.
Identifier for values to interpolate.
The representation is the following:
[]
— empty list means implicit iterators;[text]
— single key is a normal identifier;[text1, text2]
— multiple keys represent dotted names.
Identifier for partials. Note that with the OverloadedStrings
extension you can use just string literals to create values of this type.
data MustacheException Source #
Exception that is thrown when parsing of a template has failed.