templater.js

/**
 * Templater provides template services, and is accessed via the global variable 'templater'.
 * It supports Mustache-style template syntax
 * as documented <a href="http://mustache.github.io/mustache.5.html">here</a> and is a
 * very simple ('logic-less') system for generating text from templates and Javascript
 * data-objects.  The basic idea is that the template should contain macros like 
 * '`{{firstName}}`' which match the names of properties of the given Javascript
 * object.  This will result in the value of the property being substituted into the
 * template.
 * @namespace
 */
templater = {

	/**
	 * Apply the template in the file with the given (virtual file-system) path to the
	 * given data object.
	 * 
	 * @method
	 * @param {String} filePath Path to template file.
	 * @param {Object} data Object containing values to substitute into the template.
	 * @return {String}
	 */
	renderFile: function (filePath, data) { },

	/**
	 * Apply the given template to the given data object.
	 * 
	 * @method
	 * @param {String} templateString String containing the template
	 * @param {Object} data Object containing values to substitute into the template.
	 * @return {String}
	 */
	renderString: function (templateString, data) { }
}