super simple javascript template
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
readme.md
zentmpl.js

readme.md

zentmpl

Adapted from http://ejohn.org/blog/javascript-micro-templating/

MIT or GPL Version 2 licenses. Like jQuery http://jquery.org/license

Examples

var tm = "Hello, {%=this.name%}";
var data = {"name":"jethro"};

Most performant for repeated use

var hiTemplate = zentmpl(tm);
hiTemplate(data);

Single Use

zentmpl(tm)(data);

Use with jQuery

$("ul").html(hiTemplate(data));

One-liner with jquery

$("ul").html(zentmpl("Hello, {%=this.name%}")({"name":"jethro"}));

As jquery plugin

$.tmpl = zentmpl;