Permalink
Browse files

Text example using .compile()

  • Loading branch information...
1 parent 95467fb commit b313570ade3cb584302c1fc2f8ed6c0a6b0f633c @tj tj committed Dec 9, 2010
Showing with 4 additions and 6 deletions.
  1. +4 −6 examples/text.js
View
@@ -3,10 +3,8 @@
* Module dependencies.
*/
-var jade = require('./../lib/jade');
+var jade = require('./../lib/jade')
+ , str = require('fs').readFileSync(__dirname + '/text.jade', 'utf8')
+ , fn = jade.compile(str);
-var options = { locals: { name: 'tj', email: 'tj@vision-media.ca' }};
-jade.renderFile(__dirname + '/text.jade', options, function(err, html){
- if (err) throw err;
- console.log(html);
-});
+console.log(fn({ name: 'tj', email: 'tj@vision-media.ca' }));

0 comments on commit b313570

Please sign in to comment.