Skip to content

Commit

Permalink
Text example using .compile()
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Dec 9, 2010
1 parent 95467fb commit b313570
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions examples/text.js
Expand Up @@ -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.