A JR job for jade.


A jr job for jade.

var jrJade = require('jr-jade');
  inDir: 'src',
  outDir: 'out',
  options: {
    pretty: true
  locals: {
    name: 'Jade'
}, function (err) {
  if (err) {

Given src/hello.jade:

    p Hello, #{name}!

this writes out/hello.html:

<!DOCTYPE html>
    <p>Hello, Jade!</p>

Jr-jade is a function that compiles jade files into html files. Although designed to be used with jr, it does not depend on jr and can be used by itself.

All *.jade files in 'inDir' (non-recursive) will be compiled to *.html files in 'outDir' with the same basename. Because 'inDir' is not traversed recursively, jade partials can be stored in subdirectories without generating their own html files.

See the jade public API for details on 'options' and 'locals'.

Jr-jade is a thin wrapper around the jade public API. Jade provides an API to compile jade strings, and a command-line tool to compile jade files, but no API to compile files. Jr-jade fills this gap.