Home

Awesome

t.coffee

A tiny coffeescript port of a tiny javascript templating framework

t.js is a simple solution to interpolating values in an html string for insertion into the DOM via innerHTML.

t.coffee ports that simplicity to coffeescript, adding scoped iteration for concise, readable templates.

Features

t.js

t.coffee

How to use

Compile to JS as you normally would. You can also use the included Cakefile:

$ cake compile (-s/--source [SOURCEDIR]) (-o/--output [OUTPUTDIR])

Then use just like t.js:

var template = new t("<div>Hello {{=name}}</div>");
document.body.innerHTML = template.render({name: "World!"});

For more advanced usage check the t_test.html.

This software is released under the MIT license.