Copyright | © 2016–2017 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.
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.
showKey :: Key -> Text Source #
Pretty-print a key, this is helpful, for example, if you want to display an error message.
Since: 0.2.0
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 or referenced values were not provided.
MustacheParserException (ParseError Char Dec) | Template parser has failed. This contains the parse error. Before version 0.2.0 it was called |
MustacheRenderException PName Key | A referenced value was not provided. The exception provides info
about partial in which the issue happened Since: 0.2.0 |