Skip to content

Commit

Permalink
For express people - added compile function
Browse files Browse the repository at this point in the history
  • Loading branch information
olado committed Dec 28, 2011
1 parent 53e9572 commit eb14d27
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion doT.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// Licensed under the MIT license.
//
(function() {
var doT = { version : '0.1.6' };
var doT = { version : '0.1.7' };

if (typeof module !== 'undefined' && module.exports) {
module.exports = doT;
Expand Down Expand Up @@ -83,4 +83,8 @@
throw e;
}
};

doT.compile = function(tmpl, def) {
return doT.template(tmpl, null, def);
};
}());
6 changes: 6 additions & 0 deletions examples/advancedsnippet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ Compare xyz to 1, show 'xyz is not 1' if false:
if(true) block
{{ } }}

{{##def.fntest = function() {
return "Function test worked!";
}
#}}

{{#def.fntest()}}

0 comments on commit eb14d27

Please sign in to comment.