This package has been deprecated

Author message:

Please use pug-source-gen

jade-source-gen

0.0.1 • Public • Published

jade-source-gen

Generate Jade sources from a Jade AST. The resultant source may be different from the original Jade source, but the rendered output should be the same.

Build Status Dependency Status NPM version

Installation

npm install jade-source-gen

Usage

var lex = require('jade-lexer');
var parse = require('jade-parser');
var genSource = require('jade-source-gen');

var source = `
include a

mixin myMixin(arg)
  block
  p&attributes(attributes) Paragraph: #[strong= arg]

html
  head
  body
    p.klass(attr falseattr=false class=['myClass']) Introduction
    +myMixin('Content').klass2
      h1 Heading
`;
var ast = parse(lex(source));

var generatedSource = genSource(ast);
// =>
// include a
// mixin myMixin(arg)
//   block
//   p&attributes(attributes) Paragraph: #[strong= arg]
// html
//   head
//   body
//     p.klass(attr falseattr=false class=['myClass']) Introduction
//     +myMixin('Content').klass2
//       h1 Heading

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i jade-source-gen

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • forbeslindesay
  • timothygu