pugjs/pug-source-gen

Name: pug-source-gen

Owner: Pug

Description: Generate Pug source from a Pug AST.

Created: 2015-10-04 04:32:16.0

Updated: 2018-05-14 13:09:18.0

Pushed: 2018-05-14 13:09:17.0

Homepage:

Size: 14

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

pug-source-gen

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

Build Status Dependency Status NPM version

Installation
npm install pug-source-gen
Usage
lex = require('pug-lexer');
parse = require('pug-parser');
genSource = require('pug-source-gen');

source = `
ude a

n myMixin(arg)
ock
attributes(attributes) Paragraph: #[strong= arg]


ad
dy
p.klass(attr falseattr=false class=['myClass']) Introduction
+myMixin('Content').klass2
  h1 Heading

ast = parse(lex(source));

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

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.