Pug has been recently re-named from Jade. The website and documentation are still being updated, but if you're new to pug, you should install the pug package on npm.
Full documentation is at jade-lang.com
You can test drive Pug online here.
$ npm install pug
Pug is a clean, whitespace sensitive syntax for writing html. Here is a simple example:
PugPug - node template engineYou are amazingPug is a terse and simple templating language with a strong focus on performance and powerful features.
The official Pug tutorial is a great place to start.
For full API, see jade-lang.com/api
var pug = ;// compilevar fn = pug;var html = ;// rendervar html = pug;// renderFilevar html = pug;
filenameUsed in exceptions, and required when using includes
falseno debug instrumentation is compiled
prettyAdd pretty-indentation whitespace to output (false by default)
To compile a template for use on the client using the command line, do:
$ pug --client --no-debug filename.pug
which will produce
filename.js containing the compiled template.
After installing the latest version of node, install with:
$ npm install pug-cli -g
and run with
$ pug --help
Implementations in other languages: