dustjs
dustjs copied to clipboard
Improve API docs
We need tables of params. Examples of calling functions. Better descriptions.
specifically {@math} what methods can be used? I have absolutely no clue.
After reading the docs I am still clueless on why (pre)compiling a template is a two step process
dust.loadSource( dust.compile(src, 'hello') );
"loadSource"?
Here it makes even less sense:
fs.readFile(templateName + '.js', { encoding: 'utf8' }, function(err, data) {
dust.loadSource(data);
dust.render(templateName, {}, function(err, out) {
console.log(out);
});
});
Looking at the code I see https://github.com/linkedin/dustjs/blob/master/lib/dust.js#L193 loadSource just being an eval.