xjamundx/slide-web — pull request #15 by georgegg (2013-07-02 16:17:36+00:00)
Title: Switch to Underscore Templates while keeping "mustache" style syntax

I managed to use underscore templates keeping {{ }} syntax with the way you suggested (using require-jst to precompile templates).

I also manage to do so without require-jst.

I added consolodate.js to use underscore as view engine with express.js and configuring underscore templates setting to use {{ }} syntax.

_.templateSettings = {
evaluate: /\{\{(.+?)\}\}/g,
interpolate: /\{\{=(.+?)\}\}/g,
escape: /\{\{-(.+?)\}\}/g
};

Under view scripts (deck.js and slide.js) I implemented both methods (the non-precompiled method is commented). Application and dependencies configurations need some fixing now that handlebars are not required but I didn't "dig into" that.

The new tempates are deck.html and slide.html and when run the task $ grunt jst the precompiled templates are under /public/tmpl/templates.js

I registed the task to run when compiling with grunt.