Copyright | © 2016–2017 Stack Buliders |
---|---|
License | BSD 3 clause |
Maintainer | Mark Karpov <markkarpov92@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Types used in 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 {}
- showKey :: Key -> Text
- newtype PName = PName {}
- data MustacheException = MustacheParserException Text (ParseError Char Void)
- data MustacheWarning
- displayMustacheWarning :: MustacheWarning -> String
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 fails or referenced values are not provided.
MustacheParserException Text (ParseError Char Void) | Template parser has failed. This contains the parse error. Before version 0.2.0 it was called The |
data MustacheWarning Source #
Warning that may be generated during rendering of a Template
.
Since: 1.1.1
MustacheVariableNotFound Key | The template contained a variable for which there was no data counterpart in the current context. |
MustacheDirectlyRenderedValue Key | A complex value such as an |
displayMustacheWarning :: MustacheWarning -> String Source #
Pretty-print a MustacheWarning
.
Since: 1.1.1