Full documentation is at jade-lang.com
Jade is a high performance template engine heavily influenced by Haml
and implemented with JavaScript for node and browsers. For bug reports,
feature requests and questions, open an issue.
For discussion join the chat room.
You can test drive Jade online here.
Installation
via npm:
$ npm install jade
Syntax
Jade is a clean, whitespace sensitive syntax for writing html. Here is a simple example:
doctype html
html(lang="en")
head
title= pageTitle
script(type='text/javascript').
if (foo) bar(1 + 5)
body
h1 Jade - node template engine
#container.col
if youAreUsingJade
p You are amazing
else
p Get on it!
p.
Jade is a terse and simple templating language with a
strong focus on performance and powerful features.
becomes
<!DOCTYPE html>
<html lang="en">
<head>
<title>Jade</title>
<script type="text/javascript">
if (foo) bar(1 + 5)
</script>
</head>
<body>
<h1>Jade - node template engine</h1>
<div id="container" class="col">
<p>You are amazing</p>
<p>Jade is a terse and simple templating language with a strong focus on performance and powerful features.</p>
</div>
</body>
</html>
The official jade tutorial is a great place to start. While that (and the syntax documentation) is being finished, you can view some of the old documentation here and here
API
For full API, see jade-lang.com/api
var jade = require('jade');
// compile
var fn = jade.compile('string of jade', options);
var html = fn(locals);
// render
var html = jade.render('string of jade', merge(options, locals));
// renderFile
var html = jade.renderFile('filename.jade', merge(options, locals));
Options
filename
Used in exceptions, and required when using includes
compileDebug
When false
no debug instrumentation is compiled
pretty
Add pretty-indentation whitespace to output (false by default)
Browser Support
The latest version of jade can be download for the browser in standalone form from here. It only supports the very latest browsers though, and is a large file. It is recommended that you pre-compile your jade templates to JavaScript and then just use the runtime.js library on the client.
To compile a template for use on the client using the command line, do:
$ jade --client --no-debug filename.jade
which will produce filename.js
containing the compiled template.
Command Line
After installing the latest version of node, install with:
$ npm install jade -g
and run with
$ jade --help
Additional Resources
Tutorials:
Implementations in other languages:
Other:
License
MIT
Current Tags
-
1.11.0
...
latest
(9 years ago)
131 Versions
-
1.11.0
[deprecated]
...
9 years ago
-
1.10.0
[deprecated]
...
10 years ago
-
1.9.2
[deprecated]
...
10 years ago
-
1.9.1
[deprecated]
...
10 years ago
-
1.9.0
[deprecated]
...
10 years ago
-
1.8.2
[deprecated]
...
10 years ago
-
1.8.1
[deprecated]
...
10 years ago
-
1.8.0
[deprecated]
...
10 years ago
-
1.7.0
[deprecated]
...
10 years ago
-
1.6.0
[deprecated]
...
10 years ago
-
1.5.0
[deprecated]
...
10 years ago
-
1.4.2
[deprecated]
...
10 years ago
-
1.4.1
[deprecated]
...
10 years ago
-
1.4.0
[deprecated]
...
10 years ago
-
1.3.1
[deprecated]
...
11 years ago
-
1.3.0
[deprecated]
...
11 years ago
-
1.2.0
[deprecated]
...
11 years ago
-
1.1.5
[deprecated]
...
11 years ago
-
1.1.4
[deprecated]
...
11 years ago
-
1.1.3
[deprecated]
...
11 years ago
-
1.1.2
[deprecated]
...
11 years ago
-
1.1.1
[deprecated]
...
11 years ago
-
1.1.0
[deprecated]
...
11 years ago
-
1.0.2
[deprecated]
...
11 years ago
-
1.0.1
[deprecated]
...
11 years ago
-
1.0.0
[deprecated]
...
11 years ago
-
0.35.0
[deprecated]
...
11 years ago
-
0.34.1
[deprecated]
...
11 years ago
-
0.34.0
[deprecated]
...
11 years ago
-
0.33.0
[deprecated]
...
11 years ago
-
0.32.0
[deprecated]
...
11 years ago
-
0.31.2
[deprecated]
...
11 years ago
-
0.31.1
[deprecated]
...
12 years ago
-
0.31.0
[deprecated]
...
12 years ago
-
0.30.0
[deprecated]
...
12 years ago
-
0.29.0
[deprecated]
...
12 years ago
-
0.28.2
[deprecated]
...
12 years ago
-
0.28.1
[deprecated]
...
12 years ago
-
0.28.0
[deprecated]
...
12 years ago
-
0.27.7
[deprecated]
...
12 years ago
-
0.27.6
[deprecated]
...
12 years ago
-
0.27.5
[deprecated]
...
12 years ago
-
0.27.4
[deprecated]
...
12 years ago
-
0.27.3
[deprecated]
...
12 years ago
-
0.27.2
[deprecated]
...
12 years ago
-
0.27.1
[deprecated]
...
12 years ago
-
0.27.0
[deprecated]
...
12 years ago
-
0.26.3
[deprecated]
...
12 years ago
-
0.26.2
[deprecated]
...
12 years ago
-
0.26.1
[deprecated]
...
13 years ago
-
0.26.0
[deprecated]
...
13 years ago
-
0.25.0
[deprecated]
...
13 years ago
-
0.24.0
[deprecated]
...
13 years ago
-
0.23.0
[deprecated]
...
13 years ago
-
0.22.1
[deprecated]
...
13 years ago
-
0.22.0
[deprecated]
...
13 years ago
-
0.21.0
[deprecated]
...
13 years ago
-
0.20.3
[deprecated]
...
13 years ago
-
0.20.2
[deprecated]
...
13 years ago
-
0.20.1
[deprecated]
...
13 years ago
-
0.20.0
[deprecated]
...
13 years ago
-
0.19.0
[deprecated]
...
13 years ago
-
0.18.0
[deprecated]
...
13 years ago
-
0.17.0
[deprecated]
...
13 years ago
-
0.16.4
[deprecated]
...
13 years ago
-
0.16.3
[deprecated]
...
13 years ago
-
0.16.2
[deprecated]
...
13 years ago
-
0.16.1
[deprecated]
...
13 years ago
-
0.16.0
[deprecated]
...
13 years ago
-
0.15.4
[deprecated]
...
13 years ago
-
0.15.3
[deprecated]
...
13 years ago
-
0.15.2
[deprecated]
...
13 years ago
-
0.15.1
[deprecated]
...
13 years ago
-
0.15.0
[deprecated]
...
13 years ago
-
0.14.2
[deprecated]
...
13 years ago
-
0.14.1
[deprecated]
...
13 years ago
-
0.14.0
[deprecated]
...
13 years ago
-
0.13.0
[deprecated]
...
13 years ago
-
0.12.4
[deprecated]
...
13 years ago
-
0.12.3
[deprecated]
...
13 years ago
-
0.12.2
[deprecated]
...
13 years ago
-
0.12.1
[deprecated]
...
13 years ago
-
0.12.0
[deprecated]
...
14 years ago
-
0.11.1
[deprecated]
...
14 years ago
-
0.11.0
[deprecated]
...
14 years ago
-
0.10.7
[deprecated]
...
14 years ago
-
0.10.6
[deprecated]
...
14 years ago
-
0.10.5
[deprecated]
...
14 years ago
-
0.10.4
[deprecated]
...
14 years ago
-
0.10.3
[deprecated]
...
14 years ago
-
0.10.2
[deprecated]
...
14 years ago
-
0.10.1
[deprecated]
...
14 years ago
-
0.10.0
[deprecated]
...
14 years ago
-
0.9.3
[deprecated]
...
14 years ago
-
0.9.2
[deprecated]
...
14 years ago
-
0.9.1
[deprecated]
...
14 years ago
-
0.9.0
[deprecated]
...
14 years ago
-
0.8.9
[deprecated]
...
14 years ago
-
0.8.8
[deprecated]
...
14 years ago
-
0.8.7
[deprecated]
...
14 years ago
-
0.8.6
[deprecated]
...
14 years ago
-
0.8.5
[deprecated]
...
14 years ago
-
0.8.4
[deprecated]
...
14 years ago
-
0.8.3
[deprecated]
...
14 years ago
-
0.8.2
[deprecated]
...
14 years ago
-
0.8.1
[deprecated]
...
14 years ago
-
0.8.0
[deprecated]
...
14 years ago
-
0.7.1
[deprecated]
...
14 years ago
-
0.7.0
[deprecated]
...
14 years ago
-
0.6.3
[deprecated]
...
14 years ago
-
0.6.1
[deprecated]
...
14 years ago
-
0.1.0
[deprecated]
...
14 years ago
-
0.6.0
[deprecated]
...
14 years ago
-
0.5.7
[deprecated]
...
14 years ago
-
0.2.0
[deprecated]
...
14 years ago
-
0.5.5
[deprecated]
...
14 years ago
-
0.5.4
[deprecated]
...
14 years ago
-
0.0.2
[deprecated]
...
14 years ago
-
0.5.3
[deprecated]
...
14 years ago
-
0.5.2
[deprecated]
...
14 years ago
-
0.5.1
[deprecated]
...
14 years ago
-
0.5.0
[deprecated]
...
14 years ago
-
0.4.1
[deprecated]
...
14 years ago
-
0.4.0
[deprecated]
...
14 years ago
-
0.3.0
[deprecated]
...
14 years ago
-
0.2.4
[deprecated]
...
14 years ago
-
0.2.3
[deprecated]
...
14 years ago
-
0.2.2
[deprecated]
...
14 years ago
-
0.2.1
[deprecated]
...
14 years ago
-
0.0.1
[deprecated]
...
14 years ago
-
0.5.6
[deprecated]
...
14 years ago