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
- cssdeck interactive Pug syntax tutorial
- cssdeck interactive Pug logic tutorial
- Pug について。 (A Japanese Tutorial)
- Pug - 模板引擎
Implementations in other languages:
- Emacs Mode
- Vim Syntax
- TextMate Bundle
- Coda/SubEtha syntax Mode
- html2pug converter
- pug2php converter
- Pug Server Ideal for building local prototypes apart from any application