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

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

Name

mustache - Mustache - Main package

Table Of Contents

Synopsis

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 package is the highest-level package provided by the project. It provides a number of convenience commands encapsulating two common usecases.

For any not-so common case it is necessary to directly use the lower-level packages, i.e. mustache::parse, and mustache::render.

Commands

The exported commands are:

::mustache mustache template context

This command parses the mustache template, renders it using the context as the source of the data to interpolate, and returns the result.

The command throws errors when the template cannot be parsed.

The command expects context to be command prefix supporting the API of mustache::context objects.

::mustache mustache/pt template context

This command renders the pre-parsed template using the context as the source of the data to interpolate, and returns the result.

This is useful if the same template has to be applied to many different contexts, as the template will be parsed only once. Which the caller is responsible for, using the mustache::parse package.

The command expects context to be command prefix supporting the API of mustache::context objects.

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, templating