|
|
gNius is a 100% client-side Javascript template engine. It features numerous ways to iterate over Javascript objects, conditionally show markup, transform data, and more from within your HTML application.
A GTD-based task management program, Giddy, is provided as the sample or reference implementation.
Imagine you have a Javascript object (or JSON snippet):
var tasks = {
'walk the dog': {done: true},
'buy some groceries': {
start: '12/21',
tasks: {
'get bread': {done:true},
'get milk': {}
}
}
};Then some HTML:
<table>
<tr iterate="for task in tasks">
<td>{task.done}</td>
<td>{task.name} {task.tasks}</td>
<td>{task.start}</td>
<td>{task.end}</td>
</tr>
</table>Then simply tell gNius to do its magic:
gNius.parse('[iterate]');
