Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Text example using .compile()

  • Loading branch information...
commit b313570ade3cb584302c1fc2f8ed6c0a6b0f633c 1 parent 95467fb
@tj tj authored
Showing with 4 additions and 6 deletions.
  1. +4 −6 examples/text.js
View
10 examples/text.js
@@ -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' }));
Please sign in to comment.
Something went wrong with that request. Please try again.