jr-jade

0.1.8 • Public • Published

JR-JADE

A jr job for jade.

Example

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

Given src/hello.jade:

doctype
html
  body
    p Hello, #{name}!

this writes out/hello.html:

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

Details

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.

Readme

Keywords

Package Sidebar

Install

npm i jr-jade

Weekly Downloads

0

Version

0.1.8

License

none

Last publish

Collaborators

  • jraymakers