protocol MustachePageHandler
A mustache handler, which should be passed to `mustacheRequest`, generates values to fill a mustache template.
Call `context.extendValues(with: values)` one or more times and then
`context.requestCompleted(withCollector collector)` to complete the request and output the resulting content to the client.
class MustacheEvaluationContext
This class represents an individual scope for mustache template values.
A mustache template handler will return a `MustacheEvaluationContext.MapType` object as a result from its `PageHandler.valuesForResponse` function.
func getValue(named nam: String) -> MapType.Value?
Search for a value starting from the current context. If not found in the current context, the parent context will be searched, etc.
- parameter named: The name of the value to find
- returns: The value, if found, or nil
class MustacheEvaluationOutputCollector
An instance of this class will collect all output data generated by mustache tags during evaluation.
Call the `asString()` function to retreive the resulting data.
class MustacheTag
An individual mustache tag or plain-text section.
func description() -> String
Reconstitutes the tag into its original source string form.
- returns: The resulting string, including the original delimiters and tag-type marker.
class MustachePragmaTag : MustacheTag
A sub-class of MustacheTag which represents a pragma tag.
Pragma tags are "meta" tags which influence template evaluation but likely do not output any data.
class MustacheTemplate : MustacheGroupTag
This class represents a mustache template which has been parsed and is ready to evaluate.
It contains a series of "out of band" pragmas which can influence the evaluation, and a
series of children which constitute the body of the template itself.
class MustacheParser
This object will parse templates written in the mustache markup language.
Calling `parse` with the path to a file will return the resulting parsed and ready to evaluate template.