dustjs icon indicating copy to clipboard operation
dustjs copied to clipboard

Improve API docs

Open sethkinast opened this issue 10 years ago • 2 comments

We need tables of params. Examples of calling functions. Better descriptions.

sethkinast avatar Mar 26 '15 22:03 sethkinast

specifically {@math} what methods can be used? I have absolutely no clue.

kin9puppy avatar Aug 12 '15 16:08 kin9puppy

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.

tcurdt avatar Oct 26 '15 21:10 tcurdt