-
-
Notifications
You must be signed in to change notification settings - Fork 2k
/
run.js
43 lines (34 loc) · 1.23 KB
/
run.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* Module dependencies.
*/
var sys = require('sys'),
jade = require('./../lib/jade');
jade.renderFile(__dirname + '/layout.jade', function(err, html){
if (err) throw err;
sys.puts('\x1b[1mlayout.jade:\x1b[0m', html, '');
});
var users = [
{ name: 'tj', roles: ['admin'] },
{ name: 'simon', roles: [] },
{ name: 'tobi', roles: ['manager'] }
];
jade.renderFile(__dirname + '/users.jade', { locals: { users: users }}, function(err, html){
if (err) throw err;
sys.puts('\x1b[1musers.jade:\x1b[0m', html, '');
});
jade.renderFile(__dirname + '/iteration.jade', { locals: { users: users }}, function(err, html){
if (err) throw err;
sys.puts('\x1b[1miteration.jade:\x1b[0m', html, '');
});
jade.renderFile(__dirname + '/interpolation.jade', { locals: { name: 'tj', email: 'tj@vision-media.ca' }}, function(err, html){
if (err) throw err;
sys.puts('\x1b[1minterpolation.jade:\x1b[0m', html, '');
});
jade.renderFile(__dirname + '/markdown.jade', function(err, html){
if (err) throw err;
sys.puts('\x1b[1mmarkdown.jade:\x1b[0m', html, '');
});
jade.renderFile(__dirname + '/whitespace.jade', function(err, html){
if (err) throw err;
sys.puts('\x1b[1mwhitepace.jade:\x1b[0m', html, '');
});