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

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

Name

mustache::render - Mustache - Rendering parsed templates

Table Of Contents

Synopsis

  • package require mustache::render

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 package mustache::render provides the renderer for mustache templates.

Commands

::mustache render template context writer

This command takes the data structure representing a parsed mustache template (as generated by the mustache parse command provided by package mustache::parse), a context as the source of the data to interpolate, and a writer representing the destination of the interpolation result.

Both context and writer are command prefixes. Both will be invoked in arbitrarly deeply nested scopes of the rendering operation.

The context command prefix has to support the instance API of mustache::context objects.

The writer command prefix has to accept a single argument, the text to print. Note that it may be invoked multiple times as the template is rendered.

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

interpolation, logic-less templates, mustache, render, templating