Closed trentm closed 11 years ago
One should be able to do it like this:
var p = console.log;
var Mustache = require('mustache');
template = "hi {{name}}, code is\n"
+ "{{=<% %>=}}"
+ "--\n"
+ "{foo} {{bar}} {{{blah}}} <% bling %>\n"
+ "--\n"
+ "Hello again <% name %>.\n"
//+ "{{={{ }}=}}"
+ "<%={{ }}=%>"
+ "bye {{name}} . Later.\n";
var view = {
name: "Bob"
}
p(Mustache.to_html(template, view))
But for me that results in:
$ node foo.js
hi Bob, code is
--
{foo} {{bar}} {{{blah}}}
--
Hello again Bob.
bye {{name}} . Later.
IOW, returning back to the '{{name}}' delimiters is broken in this Mustache impl. Crap.
Basically I don't have a good answer for this right now. I just want to change to another templating lang. Perhaps hogan. Preferably https://github.com/paularmstrong/swig if that is sufficient.
Thanks a ton!
e.g. https://mo.joyent.com/usb-headnode/blob/master/config/sapi/manifests/services/amon/amon/template