Initial commit
This commit is contained in:
13
node_modules/pug-code-gen/HISTORY.md
generated
vendored
Normal file
13
node_modules/pug-code-gen/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
# Change log
|
||||
|
||||
## 1.1.0 / 2016-08-23
|
||||
|
||||
- Wrap `each` and `for` in IIFE to prevent variable from leaking
|
||||
|
||||
## 1.0.1 / 2016-08-10
|
||||
|
||||
- Update doctypes to 1.1.0
|
||||
|
||||
## 1.0.0 / 2016-08-10
|
||||
|
||||
- First stable release
|
19
node_modules/pug-code-gen/LICENSE
generated
vendored
Normal file
19
node_modules/pug-code-gen/LICENSE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (c) 2015 Forbes Lindesay
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
64
node_modules/pug-code-gen/README.md
generated
vendored
Normal file
64
node_modules/pug-code-gen/README.md
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
# pug-code-gen
|
||||
|
||||
Default code-generator for pug. It generates HTML via a JavaScript template function.
|
||||
|
||||
<!-- [](https://travis-ci.org/pugjs/pug-code-gen) -->
|
||||
[](https://david-dm.org/pugjs/pug?path=packages/pug-code-gen)
|
||||
[](https://www.npmjs.org/package/pug-code-gen)
|
||||
|
||||
## Installation
|
||||
|
||||
npm install pug-code-gen
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var generateCode = require('pug-code-gen');
|
||||
```
|
||||
|
||||
### `generateCode(ast, options)`
|
||||
|
||||
Generate a JavaScript function string for the given AST.
|
||||
|
||||
`ast` is a fully expanded AST for Pug, with all inclusion, extends, and filters resolved.
|
||||
|
||||
`options` may contain the following properties that have the same meaning as the options with the same names in `pug`:
|
||||
|
||||
- pretty (boolean): default is `false`
|
||||
- compileDebug (boolean): default is `true`
|
||||
- doctype (string): default is `undefined`
|
||||
- inlineRuntimeFunctions (boolean): default is `false`
|
||||
- globals (array of strings): default is `[]`
|
||||
- self (boolean): default is `false`
|
||||
|
||||
In addition to above, `pug-code-gen` has the following unique options:
|
||||
|
||||
- includeSources (object): map of filename to source string; used if `compileDebug` is `true`; default is `undefined`
|
||||
- templateName (string): the name of the generated function; default is `'template'`
|
||||
|
||||
```js
|
||||
var lex = require('pug-lexer');
|
||||
var parse = require('pug-parser');
|
||||
var wrap = require('pug-runtime/wrap');
|
||||
var generateCode = require('pug-code-gen');
|
||||
|
||||
var funcStr = generateCode(parse(lex('p Hello world!')), {
|
||||
compileDebug: false,
|
||||
pretty: true,
|
||||
inlineRuntimeFunctions: false,
|
||||
templateName: 'helloWorld'
|
||||
});
|
||||
//=> 'function helloWorld(locals) { ... }'
|
||||
|
||||
var func = wrap(funcStr, 'helloWorld');
|
||||
func();
|
||||
//=> '\n<p>Hello world!</p>'
|
||||
```
|
||||
|
||||
### `new generateCode.CodeGenerator(ast, options)`
|
||||
|
||||
The constructor for the internal class of the code generator. You shouldn't need to use this for most purposes.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
1009
node_modules/pug-code-gen/index.js
generated
vendored
Normal file
1009
node_modules/pug-code-gen/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
27
node_modules/pug-code-gen/package.json
generated
vendored
Normal file
27
node_modules/pug-code-gen/package.json
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "pug-code-gen",
|
||||
"version": "3.0.2",
|
||||
"description": "Default code-generator for pug. It generates HTML via a JavaScript template function.",
|
||||
"keywords": [
|
||||
"pug"
|
||||
],
|
||||
"dependencies": {
|
||||
"constantinople": "^4.0.1",
|
||||
"doctypes": "^1.1.0",
|
||||
"js-stringify": "^1.0.2",
|
||||
"pug-attrs": "^3.0.0",
|
||||
"pug-error": "^2.0.0",
|
||||
"pug-runtime": "^3.0.0",
|
||||
"void-elements": "^3.1.0",
|
||||
"with": "^7.0.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pugjs/pug/tree/master/packages/pug-code-gen"
|
||||
},
|
||||
"author": "Forbes Lindesay",
|
||||
"license": "MIT"
|
||||
}
|
Reference in New Issue
Block a user