[ Home | Main Table Of Contents | Table Of Contents | Keyword Index ]
NAME
mustache::parse - Mustache - Parsing templates
Table Of Contents
SYNOPSIS
package require mustache::parse
::mustache parse template ?delimiters?
DESCRIPTION
Welcome to the Mustache project for Tcl, written by Andreas Kupries.
It provides a set of five related Tcl packages for the parsing and rendering of mustache-style logic-less templates, plus an application for easy command-line access to the functionality.
For availability please read Mustache - How To Get The Sources.
Overview
The mustache::parse package provides the parser for mustache templates.
Commands
::mustache parse template ?delimiters?
This command parses the mustache template, and returns a Tcl data structure representing it.
The details of the data structure are not documented by design, they are not relevant to users of the command.
All it is necessary to know is that the mustache render command provided by the mustache::render package takes such a structure and renders it, using a context as the source of the data to interpolate.
By default the parser will use the strings {{ and }} to detect beginning and end of mustache tags. This can be overridden using the delimiters argument. It is expected to be a 2-element list of tag opener and closer strings, in this order. Note however that the same effect can be achieved by prefixing the template string with the proper mustache tag for changing the delimiters. As an example, the tag {{=<< >>=}} will change the delimiters to << and >>.
Bugs, Ideas, Feedback
Both the package(s) and this documentation will undoubtedly contain bugs and other problems. Please report such at Mustache Tracker.
Please also report any ideas you may have for enhancements of either package(s) and/or documentation.
KEYWORDS
logic-less templates, mustache, parser, templating
COPYRIGHT
Copyright © 2019-2021 Andreas Kupries
Copyright © 2019-2021 Documentation, Andreas Kupries