Copyright | (c) Justus Adam, 2015 |
---|---|
License | BSD3 |
Maintainer | dev@justus.science |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Substitution
substitute :: ToMustache k => Template -> k -> Text Source #
Substitutes all mustache defined tokens (or tags) for values found in the provided data structure.
Equivalent to substituteValue . toMustache
.
substituteValue :: Template -> Value -> Text Source #
Substitutes all mustache defined tokens (or tags) for values found in the provided data structure.
Working with Context
Representation of stateful context for the substitution process
Context [α] α |
Eq α => Eq (Context α) Source # | |
Ord α => Ord (Context α) Source # | |
Show α => Show (Context α) Source # | |
ToMustache (Context Value -> STree -> String) Source # | |
ToMustache (Context Value -> STree -> Text) Source # | |
ToMustache (Context Value -> STree -> Text) Source # | |
ToMustache (Context Value -> STree -> STree) Source # | |
search :: Context Value -> [Key] -> Maybe Value Source #
Search for a key in the current context.
The search is conducted inside out mening the current focus
is searched first. If the key is not found the outer scopes are recursively
searched until the key is found, then innerSearch
is called on the result.
innerSearch :: [Key] -> Value -> Maybe Value Source #
Searches nested scopes navigating inward. Fails if it encunters something other than an object before the key is expended.