[ Home | Main Table Of Contents | Table Of Contents | Keyword Index ]

mustache::parse(n) 1 doc "Mustache. Packages for logic-less templating"

Name

mustache::parse - Mustache - Parsing templates

Table Of Contents

Synopsis

  • package require mustache::parse

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