So siehts ganz gut aus !

This commit is contained in:
2019-04-03 17:44:16 +02:00
parent 3695b33c83
commit 0fe884c90a
6758 changed files with 530485 additions and 65 deletions

991
node_modules/pug/History.md generated vendored Normal file
View File

@@ -0,0 +1,991 @@
1.11.0 / 2015-06-12
==================
* Added block code support ([@alephyud](https://github.com/alephyud))
* Improved runtime performance of mixins significantly ([Andreas Lubbe](https://github.com/alubbe))
* Improved runtime performance of pug's string escaping ([Andreas Lubbe](https://github.com/alubbe)) and ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Better line number counting for pipeless text ([@alephyud](https://github.com/alephyud))
1.10.0 / 2015-05-25
==================
* Now supports jstransformers, which allows improved handling of embedded languages such as Coffee-Script, and deprecated Transformers support in filters - to be removed in 2.0.0 ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* CLI: added a flag to keep directory hierarchy when a directory is specified - this behavior will be the default in 2.0.0 ([@TimothyGu](https://github.com/TimothyGu))
* disabled 'compileDebug' flag by default when used with express in production mode ([Andreas Lubbe](https://github.com/alubbe))
* Fixed a memory leak on modern versions of Chrome as well as node 0.12 and iojs ([Andreas Lubbe](https://github.com/alubbe))
* update website ([@GarthDB](https://github.com/GarthDB))
1.9.2 / 2015-01-18
==================
* Do not ignore some parser errors for mismatched parenthesis ([@TimothyGu](https://github.com/TimothyGu))
* Warn for `:` that is not followed by a space ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Fix #1794 (a bizzare bug with a certain combination of inheritance, mixins and &attributes) ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Add `compileClientWithDependenciesTracked` ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Support comments in `case` blocks ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Fix blocks in nested mixins ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Lots more documentation ([@enlore](https://github.com/enlore))
* Fix watching in CLI ([@pavel](https://github.com/pavel))
1.9.1 / 2015-01-17
==================
* Clean up path/fs functions in CLI as we no longer support node@0.6 ([@TimothyGu](https://github.com/TimothyGu))
* Update commander ([@TimothyGu](https://github.com/TimothyGu))
* Document `cache` and `parser` options ([@TimothyGu](https://github.com/TimothyGu))
* Fix bug in 1.9.0 where we read the file if cache was enabled, even if a string was provided ([@TimothyGu](https://github.com/TimothyGu))
* Fix year in changelog ([@tomByrer](https://github.com/tomByrer))
1.9.0 / 2015-01-13
==================
* Fix `--watch` sometimes dying when there were file-system errors ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Fix `--watch` by using `fs.watchFile` correctly ([@TimothyGu](https://github.com/TimothyGu))
* Fix errors with using the CLI to compile from stdin
* Better looking badges ([@TimothyGu](https://github.com/TimothyGu))
* Added `--extension` to CLI([@nicocedron](https://github.com/nicocedron) and [@TimothyGu](https://github.com/TimothyGu))
* Refactor and improve internal cache handling ([@TimothyGu](https://github.com/TimothyGu))
* Loads more tests ([@TimothyGu](https://github.com/TimothyGu))
1.8.2 / 2014-12-16
==================
* Use `-` as the default filename when using stdin on CLI ([@TimothyGu](https://github.com/TimothyGu))
* Prevent some compiler errors being silenced ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Remove use of non-standard `string.trimLeft()` ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Fix bug in CLI when no name was provided for child template ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Remove dependency on monocle (hopefully fixing installation on 0.8) ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Add gitter chat room ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
1.8.1 / 2014-11-30
==================
* Fix corner case when the pretty option was passed a non-string truthy value ([@TimothyGu](https://github.com/TimothyGu))
* Warn when `lexer` is given as an option ([@TimothyGu](https://github.com/TimothyGu))
* Update dependencies ([@TimothyGu](https://github.com/TimothyGu))
1.8.0 / 2014-11-28
==================
* Fix empty text-only block ([@rlidwka](https://github.com/rlidwka))
* Warn about future change to ISO 8601 style dates ([@TimothyGu](https://github.com/TimothyGu) and [@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Add warnings when data-attributes contain ampersands ([@TimothyGu](https://github.com/TimothyGu))
* Allow custom pretty indentation ([@bfred-it](https://github.com/bfred-it))
* Add support for an object in the style attribute ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Add support for an object in the class attribute ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Ignore fs module in browser builds ([@sokra](https://github.com/sokra))
* Update dependencies ([@hildjj](https://github.com/hildjj))
* Check mixin arguments are valid JavaScript expressions ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Remove symlink ([@slang800](https://github.com/slang800))
1.7.0 / 2014-09-17
==================
* Add Doctype option on command line ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Support ES6 style rest args in mixins ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Fix support for unicode newlines (\u2028, \u2029) ([@rlidwka](https://github.com/rlidwka))
* Expose `globals` option from the `with` module ([@sokra](https://github.com/sokra))
* Lots of new documentation ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
1.6.0 / 2014-08-31
==================
* Allow optional white space after `+` when calling a mixin ([@char101](https://github.com/char101))
* Use void-elements module to replace internal self-closing list ([@hemanth](https://github.com/hemanth))
* Fix a warning that eroniously warned for un-used blocks if in an extending template from an include (Reported by [@Dissimulazione](https://github.com/Dissimulazione))
* Fix mixins not working at end of file ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Fix error reporting when mixin block was followed by blank lines ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
1.5.0 / 2014-07-23
==================
* Added compileFile API ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Fix line number in un-used blocks warning ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Fix a warning that eroniously warned for un-used blocks if they were under another block (Reported by [@pesho](https://github.com/pesho))
1.4.2 / 2014-07-16
==================
* Fix a warning that eroniously warned for un-used blocks if they were under a "Code" element (Reported by [@narirou](https://github.com/narirou))
1.4.1 / 2014-07-16
==================
* Fix an error that sometimes resulted in 'unexpected token "pipless-text"' being erroniously thrown (Reported by [@Artazor](https://github.com/Artazor) and [@thenitai](https://github.com/thenitai))
1.4.0 / 2014-07-15
==================
* Fix CLI so it keeps watching when errors occur ([@AndrewTsao](https://github.com/AndrewTsao))
* Support custom names for client side templates ([@ForbesLindesay](http://www.forbeslindesay.co.uk/) and [@dscape](https://github.com/dscape))
* Allow whitepsace other than "space" before attributes passed to mixins (N.B. there is a small chance this could be a breaking change for you) ([@regular](https://github.com/regular))
* Track dependencies so file watchers can be more clever ([@ForbesLindesay](http://www.forbeslindesay.co.uk/) and [@sdether](https://github.com/sdether))
* Allow passing options to filtered includes ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Fix bugs with indentation in filters ([@ForbesLindesay](http://www.forbeslindesay.co.uk/) and [@lackac](https://github.com/lackac))
* Warn on block names that are never used ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
1.3.1 / 2014-04-04
==================
* Fix error with tags in xml that are self-closing in html ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Fix error message for inline tags with content ([@hiddentao](https://github.com/hiddentao))
1.3.0 / 2014-03-02
==================
* Fix a bug where sometimes mixins were removed by an optimisation even though they were being called ([@ForbesLindesay](http://www.forbeslindesay.co.uk/), reported by [@leider](https://github.com/leider))
* Updated with to support automatically detecting when a value is "global" and removed redundant `options.globals` option ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Improve warnings for tags with multiple attributes ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Deprecate (with a warning) `node.clone`, `block.replace`, `attrs.removeAttribute`, `attrs.getAttribute` - these are all internal APIs for the AST ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
1.2.0 / 2014-02-26
==================
* Use variables instead of properties of pug, improving performance and reliability with nested templates ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Support compiling templates from stdin via a user typing ([@yorkie](https://github.com/yorkie))
* Lazily add mixins ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Fix case fall-through ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Earlier errors for `when` without `case` and `else` without `if` ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Allow `if`/`else` etc. to not have a block.
* Remove lib-cov legacy to make browserify work better ([@silver83](https://github.com/silver83))
* Add and improve test coverage using istanbul ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
1.1.5 / 2014-01-19
==================
* Add filename to and fix line numbers for missing space before text warning (@ijin82)
* Fix filenames for some error reporting in extends/includes (@doublerebel)
* Fix a corner case where a mixin was called with `&attributes` but no other attributes and a block that was supposed to be fixed in 1.1.4 ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
1.1.4 / 2014-01-09
==================
* Fix a corner case where a mixin was called with `&attributes` but no other attributes and a block ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
1.1.3 / 2014-01-09
==================
* Fix failure of npm prepublish not running
1.1.2 / 2014-01-09
==================
* Fix same interaction of `&attributes` with `false` `null` or `undefined` but combined with dynamic attributes ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
1.1.1 / 2014-01-09
==================
* Fix a bug when `&attributes` is combined with static attributes that evaluate to `false` or `null` or `undefined` ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
1.1.0 / 2014-01-07
==================
* Fix class merging to work as documented ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Throw an error when the same attribute is duplicated multiple times ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Move more errors into the parser/lexer so they have more info about line numbers ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Support mixin blocks at the end of files ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
1.0.2 / 2013-12-31
==================
* Fix a bug when `&attributes` is combined with dynamic attributes ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
1.0.1 / 2013-12-29
==================
* Allow self closing tags to contian whitespace ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Allow tags to have a single white space after them ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Support text bodies of tags that begin with `//` rather than treating them as comments ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
1.0.0 / 2013-12-22
==================
* No longer support node@0.8 ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Fix error reporting in layouts & includes ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Allow a list of 'globals' to be passed as an array at compile time & don't automatically expose all globals ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Escape apostrophes in data attributes (@qualiabyte)
* Fix mixin/block interaction ([@ForbesLindesay](http://www.forbeslindesay.co.uk/) & [@paulyoung](https://github.com/paulyoung))
* Ignore trailing space after mixin declaration ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Make literal `.` work as expected ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Remove implicit text only for script/style ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Stop parsing comments and remove support for conditional comments ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Make filtering includes explicit ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Remove special assignment syntax ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Remove `!!!` shortcut for `doctype` ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Remove `5` shorcut for `html` doctype ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Remove `colons` option from the distant past ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Add a sepatate `compileClient` and `compileFileClient` to replace the `client` option ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Remove polyfills for supporting old browsers ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Allow interpolation for mixin names ([@jeromew](https://github.com/jeromew)
* Use `node.type` instead of `node.constructor.name` so it can be minified ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Allow hyphens in filter names ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Throw an error if a self closing tag has content ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Support inline tags ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Replace `attributes` magic attribute with `&attributes(attributes)` ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Remove automatic tag wrapping for filters, you can just put the tags in yourself now ([@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Remove whitespace from tags nested inside pre tags ([@markdalgleish](http://markdalgleish.com))
0.35.0 / 2013-08-21
===================
* Add support for space separated attributes (thanks to [@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Add earlier errors for invalid JavaScript expressions (thanks to [@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* Fix parsing files with UTF8 BOMs when they are includes or parent/layout templates (thanks to [@kiinoo](https://github.com/kiinoo))
0.34.1 / 2013-07-26
===================
* fix render file not working when called with callback (reported by [@xieren58](https://github.com/xieren58))
0.34.0 / 2013-07-26
===================
* callbacks only called once for async methods even if they throw (reported by [@davidcornu](https://github.com/davidcornu))
* HTML comments are pretty printed better (thanks to [@eddiemonge](https://github.com/eddiemonge))
* callbacks are optional and leaving them out results in synchronous operation (thanks to [@ForbesLindesay](http://www.forbeslindesay.co.uk/))
* empty filter nodes are now permitted (thanks to [@coderanger](https://github.com/coderanger))
* overhaul website and documentation (thanks to [@ForbesLindesay](http://www.forbeslindesay.co.uk/)), much more of this to come.
0.33.0 / 2013-07-12
===================
* Hugely more powerful error reporting (especially with `compileDebug` set explicitly to `true`)
* Add a warning for tags with multiple attributes
* be strict about requiring newlines after tags to fix some odd corner cases
* fix escaping of class to allow it to be unescaped (thanks to [@christiangenco](https://github.com/christiangenco))
0.32.0 / 2013-06-28
===================
* remove `pug.version` and fix `pug --version`
* add file name and line number to deprecation warnings
* use constantinople for better constant detection
* update `with` for a massive performance upgrade at compile time
0.31.2 / 2013-06-07
===================
* fix overzealous deprecation warnings
0.31.1 / 2013-05-31
===================
* fix line endings for executable command
* fix `locals` variable being undefined
* fix an obscure bug that could occur if multiple mixins interact badly (see [substack/lexical-scope#13](https://github.com/substack/lexical-scope/issues/13))
0.31.0 / 2013-05-30
==================
* deprecate implicit text-only `script` and `style` tags
* make `with` at compile time using `lexical-scope`
* add `options.parser` that behaves exactly like `options.compiler`
* add "component.json" for component (runtime) support
* removed `hasOwnProperty` check in each loops
* removed .min files from the repository (people can just generate these themselves)
* use browserify to compile client side libraries
* fix buggy block extending should now be fixed
* fix preserve case of custom doctypes
* fix regexps in attributes sometimes not being accepted
* fix allow `$` sign in each loop variable names
* fix mixins with buffered code on the same line
* fix separate class names by ` ` rather than `,` (was sometimes incorrect)
0.30.0 / 2013-04-25
==================
* add support for 'include' and 'extends' to use paths relative to basedir
* fix accidental calling of functions in iteration block. Closes #986
* fix: skip rethrow on client
* fix each/else prefixed with `-`
* fix multi-block prepend/append
* swap -o and -O, set -o to --out
0.29.0 / 2013-04-16
==================
* add "monocle" for watcher that actually works...
* fix interpolation in blocks of text
* fix attribute interpolation
* move filters to an external library
* fix JavaScript escaping corner cases
0.28.2 / 2013-03-04
==================
* wtf coffeescript is not a dep
0.28.1 / 2013-01-10
==================
* add passing of filename to include filters
* fix wrong new lines for include filters
0.28.0 / 2013-01-08
==================
* add .css and .js "filters". re #438
* add include filters. Closes #283
* fix "class:" within attribute escaping
* removing ast filters
* things I can't read:
* 反馈地址
* 样式
* 联系
* 初稿,翻译完
* 接受大鸟的建议
* 头晕,翻译一点点
* 到过滤器翻译完毕
* 翻译一部分
* 中文翻译单独放
* 特性部分
* 再翻
* 翻译一点点
0.27.7 / 2012-11-05
==================
* fix each/else clause for enumerated objects
* fix #764 (incorrect line number for error messages)
* fix double-escaping of interpolated js slashes. Closes #784
0.27.6 / 2012-10-05
==================
* Included templates can not override blocks of their parent. Closes #699
0.27.5 / 2012-09-24
==================
* fix attr interpolation escaping. Closes #771
0.27.4 / 2012-09-18
==================
* fix include yields. Closes #770
0.27.3 / 2012-09-18
==================
* fix escaping of interpolation. Closes #769
* loosen "mkdirp" version restriction [TooTallNate]
0.27.2 / 2012-08-07
==================
* Revert "fixing string interpolation escaping #731", problems reported
0.27.1 / 2012-08-06
==================
* fix attribute interpolation escaping #731
* fix string interpolation escaping #731
0.27.0 / 2012-07-26
==================
* added ability to pass in json file to `--obj`
* add preliminary `each` `else` support. Closes #716
* fix doctype bug overlooked in #712
* fix stripping of utf-8 BOMs
0.26.3 / 2012-06-25
==================
* Update version of commander that supports node v0.8.
0.26.2 / 2012-06-22
==================
* Added --options alias of --obj
* Added reserved word conflict prevention in Google's Closure Compiler
* Added tag interpolation. Closes #657
* Allow the compiled client to use it's own pug util functions [3rd-Eden]
* Fixed `attrs()` escape bug [caseywebdev]
0.26.1 / 2012-05-27
==================
* Changed default doctype to __html5__
* Performance: statically compile attrs when possible [chowey]
* Fixed some class attribute merging cases
* Fixed so `block` doesn't consume `blockquotes` tag [chowey]
* Fixed backslashes in text nodes [chowey]
* Fixed / in text. Closes #638
0.26.0 / 2012-05-04
==================
* Added package.json __component__ support
* Added explicit self-closing tag support. Closes #605
* Added `block` statement
* Added mixin tag-like behaviour [chowey]
* Fixed mixins with extends [chowey]
0.25.0 / 2012-04-18
==================
* Added preliminary mixin block support. Closes #310
* Fixed whitespace handling in various situations [chowey]
* Fixed indentation in various situations [chowey]
0.24.0 / 2012-04-12
==================
* Fixed unescaped attribute compilation
* Fixed pretty-printing of text-only tags (__Warning__: this may affect rendering) [chowey]
0.23.0 / 2012-04-11
==================
* Added data-attr json stringification support. Closes #572
* Added unescaped attr support. Closes #198
* Fixed #1070, reverted mixin function statements
* Fixed pug.1 typo
0.22.1 / 2012-04-04
==================
* Fixed source tags. now self-closing. Closes #308
* Fixed: escape backslashes in coffeescript filter
0.22.0 / 2012-03-22
==================
* Added pug manpage (`man pug` after installation for docs)
* Added `-D, --no-debug` to pug(1)
* Added `-p, --pretty` to pug(1)
* Added `-c, --client` option to pug(1)
* Fixed `-o { client: true }` with stdin
* Fixed: skip blank lines in lexer (unless within pipeless text). Closes #399
0.21.0 / 2012-03-10
==================
* Added new input/output test suite using Mocha's string diffing
* Added alias `extend` -> `extends`. Closes #527 [guillermo]
* Fixed include escapes. Closes #513
* Fixed block-expansion with .foo and #foo short-hands. Closes #498
0.20.3 / 2012-02-16
==================
* Changed: pass `.filename` to filters only
0.20.2 / 2012-02-16
==================
* Fixed `:stylus` import capabilities, pass .filename
0.20.1 / 2012-02-02
==================
* Fixed Block#includeBlock() with textOnly blocks
0.20.0 / 2011-12-28
==================
* Added a browser example
* Added `yield` for block `include`s
* Changed: replaced internal `__` var with `__pug` [chrisleishman]
* Fixed two globals. Closes #433
0.19.0 / 2011-12-02
==================
* Added block `append` / `prepend` support. Closes #355
* Added link in readme to pug-mode for Emacs
* Added link to python implementation
0.18.0 / 2011-11-21
==================
* Changed: only ['script', 'style'] are text-only. Closes #398'
0.17.0 / 2011-11-10
==================
* pug.renderFile() is back! (for express 3.x)
* Fixed `Object.keys()` failover bug
0.16.4 / 2011-10-24
==================
* Fixed a test due to reserved keyword
* Fixed: commander 0.1.x dep for 0.5.x
0.16.3 / 2011-10-24
==================
* Added: allow leading space for conditional comments
* Added quick implementation of a switch statement
* Fixed parens in mixin args. Closes #380
* Fixed: include files with a .pug extension as pug files
0.16.2 / 2011-09-30
==================
* Fixed include regression. Closes #354
0.16.1 / 2011-09-29
==================
* Fixed unexpected `else` bug when compileDebug: false
* Fixed attr state issue for balancing pairs. Closes #353
0.16.0 / 2011-09-26
==================
* Added `include` block support. Closes #303
* Added template inheritance via `block` and `extends`. Closes #242
* Added 'type="text/css"' to the style tags generated by filters.
* Added 'uglifyjs' as an explicit devDependency.
* Added -p, --path <path> flag to pug(1)
* Added support for any arbitrary doctype
* Added `pug.render(str[,options], fn)` back
* Added first-class `while` support
* Added first-class assignment support
* Fixed runtime.js `Array.isArray()` polyfill. Closes #345
* Fixed: set .filename option in pug(1) when passing filenames
* Fixed `Object.keys()` polyfill typo. Closes #331
* Fixed `include` error context
* Renamed magic "index" to "$index". Closes #350
0.15.4 / 2011-09-05
==================
* Fixed script template html. Closes #316
* Revert "Fixed script() tag with trailing ".". Closes #314"
0.15.3 / 2011-08-30
==================
* Added Makefile example. Closes #312
* Fixed script() tag with trailing ".". Closes #314
0.15.2 / 2011-08-26
==================
* Fixed new conditional boundaries. Closes #307
0.15.1 / 2011-08-26
==================
* Fixed pug(1) support due to `res.render()` removal
* Removed --watch support (use a makefile + watch...)
0.15.0 / 2011-08-26
==================
* Added `client` option to reference runtime helpers
* Added `Array.isArray()` for runtime.js as well
* Added `Object.keys()` for the client-side runtime
* Added first-class `if`, `unless`, `else` and `else if` support
* Added first-class `each` / `for` support
* Added `make benchmark` for continuous-bench
* Removed `inline` option, SS helpers are no longer inlined either
* Removed `Parser#debug()`
* Removed `pug.render()` and `pug.renderFile()`
* Fixed runtime.js `escape()` bug causing window.escape to be used
* Fixed a bunch of tests
0.14.2 / 2011-08-16
==================
* Added `include` support for non-pug files
* Fixed code indentation when followed by newline(s). Closes #295 [reported by masylum]
0.14.1 / 2011-08-14
==================
* Added `colons` option for everyone stuck with ":". Closes #231
* Optimization: consecutive lines are merged in compiled js
0.14.0 / 2011-08-08
==================
* Added array iteration with index example. Closes #276
* Added _runtime.js_
* Added `compileDebug` option to enable lineno instrumentation
* Added `inline` option to disable inlining of helpers (for client-side)
0.13.0 / 2011-07-13
==================
* Added `mixin` support
* Added `include` support
* Added array support for the class attribute
0.12.4 / 2011-06-23
==================
* Fixed filter indentation bug. Closes #243
0.12.3 / 2011-06-21
==================
* Fixed empty strings support. Closes #223
* Fixed conditional comments documentation. Closes #245
0.12.2 / 2011-06-16
==================
* Fixed `make test`
* Fixed block comments
0.12.1 / 2011-06-04
==================
* Fixed attribute interpolation with double quotes. Fixes #232 [topaxi]
0.12.0 / 2011-06-03
==================
* Added `doctype` as alias of `!!!`
* Added; doctype value is now case-insensitive
* Added attribute interpolation support
* Fixed; retain original indentation spaces in text blocks
0.11.1 / 2011-06-01
==================
* Fixed text block indentation [Laszlo Bacsi]
* Changed; utilizing devDependencies
* Fixed try/catch issue with renderFile(). Closes #227
* Removed attribute ":" support, use "=" (option for ':' coming soon)
0.11.0 / 2011-05-14
==================
* Added `self` object to avoid poor `with(){}` performance [masylum]
* Added `doctype` option [Jeremy Larkin]
0.10.7 / 2011-05-04
==================
* expose Parser
0.10.6 / 2011-04-29
==================
* Fixed CS `Object.keys()` [reported by robholland]
0.10.5 / 2011-04-26
==================
* Added error context after the lineno
* Added; indicate failing lineno with ">"
* Added `Object.keys()` for the client-side
* Fixed attr strings when containing the opposite quote. Closes 207
* Fixed attr issue with js expressions within strings
* Fixed single-quote filter escape bug. Closes #196
0.10.4 / 2011-04-05
==================
* Added `html` doctype, same as "5"
* Fixed `pre`, no longer text-only
0.10.3 / 2011-03-30
==================
* Fixed support for quoted attribute keys ex `rss("xmlns:atom"="atom")`
0.10.2 / 2011-03-30
==================
* Fixed pipeless text bug with missing outdent
0.10.1 / 2011-03-28
==================
* Fixed `support/compile.js` to exclude browser js in node
* Fixes for IE [Patrick Pfeiffer]
0.10.0 / 2011-03-25
==================
* Added AST-filter support back in the form of `<tag>[attrs]<:><block>`
0.9.3 / 2011-03-24
==================
* Added `Block#unshift(node)`
* Added `pug.js` for the client-side to the repo
* Added `pug.min.js` for the client-side to the repo
* Removed need for pipes in filters. Closes #185
Note that this _will_ break filters used to
manipulate the AST, until we have a different
syntax for doing so.
0.9.2 / 2011-03-23
==================
* Added pug `--version`
* Removed `${}` interpolation support, use `#{}`
0.9.1 / 2011-03-16
==================
* Fixed invalid `.map()` call due to recent changes
0.9.0 / 2011-03-16
==================
* Added client-side browser support via `make pug.js` and `make pug.min.js`.
0.8.9 / 2011-03-15
==================
* Fixed preservation of newlines in text blocks
0.8.8 / 2011-03-14
==================
* Fixed pug(1) stdio
0.8.7 / 2011-03-14
==================
* Added `mkdirs()` to pug(1)
* Added pug(1) stdio support
* Added new features to pug(1), `--watch`, recursive compilation etc [khingebjerg]
* Fixed pipe-less text newlines
* Removed pug(1) `--pipe` flag
0.8.6 / 2011-03-11
==================
* Fixed parenthesized expressions in attrs. Closes #170
* Changed; default interpolation values `== null` to ''. Closes #167
0.8.5 / 2011-03-09
==================
* Added pipe-less text support with immediate ".". Closes #157
* Fixed object support in attrs
* Fixed array support for attrs
0.8.4 / 2011-03-08
==================
* Fixed issue with expressions being evaluated several times. closes #162
0.8.2 / 2011-03-07
==================
* Added markdown, discount, and markdown-js support to `:markdown`. Closes #160
* Removed `:discount`
0.8.1 / 2011-03-04
==================
* Added `pre` pipe-less text support (and auto-escaping)
0.8.0 / 2011-03-04
==================
* Added block-expansion support. Closes #74
* Added support for multi-line attrs without commas. Closes #65
0.7.1 / 2011-03-04
==================
* Fixed `script()` etc pipe-less text with attrs
0.7.0 / 2011-03-04
==================
* Removed `:javascript` filter (it doesn't really do anything special, use `script` tags)
* Added pipe-less text support. Tags that only accept text nodes (`script`, `textarea`, etc) do not require `|`.
* Added `:text` filter for ad-hoc pipe-less
* Added flexible indentation. Tabs, arbitrary number of spaces etc
* Added conditional-comment support. Closes #146
* Added block comment support
* Added rss example
* Added `:stylus` filter
* Added `:discount` filter
* Fixed; auto-detect xml and do not self-close tags. Closes #147
* Fixed whitespace issue. Closes #118
* Fixed attrs. `,`, `=`, and `:` within attr value strings are valid Closes #133
* Fixed; only output "" when code == null. Ex: `span.name= user.name` when undefined or null will not output "undefined". Closes #130
* Fixed; throw on unexpected token instead of hanging
0.6.3 / 2011-02-02
==================
* Added `each` support for Array-like objects [guillermo]
0.6.2 / 2011-02-02
==================
* Added CSRF example, showing how you can transparently add inputs to a form
* Added link to vim-pug
* Fixed self-closing col support [guillermo]
* Fixed exception when getAttribute or removeAttribute run into removed attributes [Naitik Shah]
0.6.0 / 2010-12-19
==================
* Added unescaped interpolation variant `!{code}`. Closes #124
* Changed; escape interpolated code by default `#{code}`
0.5.7 / 2010-12-08
==================
* Fixed; hyphen in get `tag()`
0.5.6 / 2010-11-24
==================
* Added `exports.compile(str, options)`
* Renamed internal `_` to `__`, since `_()` is commonly used for translation
0.5.5 / 2010-10-30
==================
* Add _coffeescript_ filter [Michael Hampton]
* Added link to _slim_; a ruby implementation
* Fixed quoted attributes issue.
* Fixed attribute issue with over greedy regexp.
Previously "p(foo=(((('bar')))))= ((('baz')))"
would __fail__ for example since the regexp
would lookahead to far. Now we simply pair
the delimiters.
0.5.4 / 2010-10-18
==================
* Adding newline when using tag code when preceding text
* Assume newline in tag text when preceding text
* Changed; retain leading text whitespace
* Fixed code block support to prevent multiple buffer openings [Jake Luer]
* Fixed nested filter support
0.5.3 / 2010-10-06
==================
* Fixed bug when tags with code also have a block [reported by chrisirhc]
0.5.2 / 2010-10-05
==================
* Added; Text introduces newlines to mimic the grammar.
Whitespace handling is a little tricky with this sort of grammar.
Pug will now mimic the written grammar, meaning that text blocks
using the "|" margin character will introduce a literal newline,
where as immediate tag text (ex "a(href='#') Link") will not.
This may not be ideal, but it makes more sense than what Pug was
previously doing.
* Added `Tag#text` to disambiguate between immediate / block text
* Removed _pretty_ option (was kinda useless in the state it was in)
* Reverted ignoring of newlines. Closes #92.
* Fixed; `Parser#parse()` ignoring newlines
0.5.1 / 2010-10-04
==================
* Added many examples
* Added; compiler api is now public
* Added; filters can accept / manipulate the parse tree
* Added filter attribute support. Closes #79
* Added LL(*) capabilities
* Performance; wrapping code blocks in {} instead of `(function(){}).call(this)`
* Performance; Optimized attribute buffering
* Fixed trailing newlines in blocks
0.5.0 / 2010-09-11
==================
* __Major__ refactor. Logic now separated into lexer/parser/compiler for future extensibility.
* Added _pretty_ option
* Added parse tree output for _debug_ option
* Added new examples
* Removed _context_ option, use _scope_
0.4.1 / 2010-09-09
==================
* Added support for arbitrary indentation for single-line comments. Closes #71
* Only strip first space in text (ex '| foo' will buffer ' foo')
0.4.0 / 2010-08-30
==================
* Added tab naive support (tabs are converted to a single indent, aka two spaces). Closes #24
* Added unbuffered comment support. Closes #62
* Added hyphen support for tag names, ex: "fb:foo-bar"
* Fixed bug with single quotes in comments. Closes #61
* Fixed comment whitespace issue, previously padding. Closes #55
0.3.0 / 2010-08-04
==================
* Added single line comment support. Closes #25
* Removed CDATA from _:javascript_ filter. Closes #47
* Removed _sys_ local
* Fixed code following tag
0.2.4 / 2010-08-02
==================
* Added Buffer support to `render()`
* Fixed filter text block exception reporting
* Fixed tag exception reporting
0.2.3 / 2010-07-27
==================
* Fixed newlines before block
* Fixed; tag text allowing arbitrary trailing whitespace
0.2.2 / 2010-07-16
==================
* Added support for `pug.renderFile()` to utilize primed cache
* Added link to [textmate bundle](http://github.com/miksago/pug-tmbundle)
* Fixed filter issue with single quotes
* Fixed hyphenated attr bug
* Fixed interpolation single quotes. Closes #28
* Fixed issue with comma in attrs
0.2.1 / 2010-07-09
==================
* Added support for node-discount and markdown-js
depending on which is available.
* Added support for tags to have blocks _and_ text.
this kinda fucks with arbitrary whitespace unfortunately,
but also fixes trailing spaces after tags _with_ blocks.
* Caching generated functions. Closes #46
0.2.0 / 2010-07-08
==================
* Added `- each` support for readable iteration
* Added [markdown-js](http://github.com/evilstreak/markdown-js) support (no compilation required)
* Removed node-discount support
0.1.0 / 2010-07-05
==================
* Added `${}` support for interpolation. Closes #45
* Added support for quoted attr keys: `label("for": 'something')` is allowed (_although not required_) [Guillermo]
* Added `:less` filter [jakeluer]
0.0.2 / 2010-07-03
==================
* Added `context` as synonym for `scope` option [Guillermo]
* Fixed attr splitting: `div(style:"color: red")` is now allowed
* Fixed issue with `(` and `)` within attrs: `a(class: (a ? 'a' : 'b'))` is now allowed
* Fixed issue with leading / trailing spaces in attrs: `a( href="#" )` is now allowed [Guillermo]

22
node_modules/pug/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2009-2014 TJ Holowaychuk <tj@vision-media.ca>
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.

168
node_modules/pug/README.md generated vendored Normal file
View File

@@ -0,0 +1,168 @@
<!-- Coppied from root directory -->
<a href="https://pugjs.org"><img src="https://cdn.rawgit.com/pugjs/pug-logo/eec436cee8fd9d1726d7839cbe99d1f694692c0c/SVG/pug-final-logo-_-colour-128.svg" height="200" align="right"></a>
# Pug
Full documentation is at [pugjs.org](https://pugjs.org/)
Pug is a high performance template engine heavily influenced by [Haml](http://haml.info/)
and implemented with JavaScript for [Node.js](http://nodejs.org) and browsers. For bug reports,
feature requests and questions, [open an issue](https://github.com/pugjs/pug/issues/new).
For discussion join the [chat room](https://gitter.im/pugjs/pug).
You can test drive Pug online [here](https://pugjs.org/).
[![Build Status](https://img.shields.io/travis/pugjs/pug/master.svg?style=flat)](https://travis-ci.org/pugjs/pug)
[![Coverage Status](https://img.shields.io/coveralls/pugjs/pug/master.svg?style=flat)](https://coveralls.io/r/pugjs/pug?branch=master)
[![Dependency Status](https://img.shields.io/david/pugjs/pug.svg?style=flat)](https://david-dm.org/pugjs/pug)
[![devDependencies Status](https://img.shields.io/david/dev/pugjs/pug.svg?style=flat)](https://david-dm.org/pugjs/pug?type=dev)
[![NPM version](https://img.shields.io/npm/v/pug.svg?style=flat)](https://www.npmjs.com/package/pug)
[![Join Gitter Chat](https://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg?style=flat)](https://gitter.im/pugjs/pug?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Rename from "Jade"
This project was formerly known as "Jade." However, it has been revealed to us that "Jade" is a registered trademark, and as a result a rename is needed. After some discussion among the maintainers, **"Pug"** has been chosen as the new name for this project. The next major version will carry "pug" as the package name.
If your package or app currently uses `jade`, don't worry: we have secured permissions to continue to occupy that package name, although all new versions will be released under `pug`.
Before the renaming, we had already begun working on an incompatible Jade 2.0.0. We have then made it so that this new major version bump will coincide with the rename to Pug. Therefore, upgrading from Jade to Pug will be the same process as upgrading any other package with a major version bump. Currently, Pug 2.0.0 is still under beta stage, and there are several syntactic differences we have deprecated and removed. Such differences are documented at [#2305](https://github.com/pugjs/pug/issues/2305).
The website and documentation for Pug are still being updated, but if you are new to Pug, you should get started with the new syntax and install the Pug package on npm.
## Installation
### Package
via npm:
```bash
$ npm install pug
```
### Command Line
After installing the latest version of [Node.js](http://nodejs.org/), install with:
```bash
$ npm install pug-cli -g
```
and run with
```bash
$ pug --help
```
## Syntax
Pug is a clean, whitespace sensitive syntax for writing html. Here is a simple example:
```pug
doctype html
html(lang="en")
head
title= pageTitle
script(type='text/javascript').
if (foo) bar(1 + 5)
body
h1 Pug - node template engine
#container.col
if youAreUsingPug
p You are amazing
else
p Get on it!
p.
Pug is a terse and simple templating language with a
strong focus on performance and powerful features.
```
becomes
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Pug</title>
<script type="text/javascript">
if (foo) bar(1 + 5)
</script>
</head>
<body>
<h1>Pug - node template engine</h1>
<div id="container" class="col">
<p>You are amazing</p>
<p>Pug is a terse and simple templating language with a strong focus on performance and powerful features.</p>
</div>
</body>
</html>
```
## API
For full API, see [pugjs.org/api/reference.html](https://pugjs.org/api/reference.html)
```js
var pug = require('pug');
// compile
var fn = pug.compile('string of pug', options);
var html = fn(locals);
// render
var html = pug.render('string of pug', merge(options, locals));
// renderFile
var html = pug.renderFile('filename.pug', merge(options, locals));
```
### Options
- `filename` Used in exceptions, and required when using includes
- `compileDebug` When `false` no debug instrumentation is compiled
- `pretty` Add pretty-indentation whitespace to output _(false by default)_
## Browser Support
The latest version of pug can be download for the browser in standalone form from [here](https://pugjs.org/js/pug.js). It only supports the very latest browsers though, and is a large file. It is recommended that you pre-compile your pug templates to JavaScript.
To compile a template for use on the client using the command line, do:
```bash
$ pug --client --no-debug filename.pug
```
which will produce `filename.js` containing the compiled template.
## Additional Resources
Tutorials:
- cssdeck interactive [Pug syntax tutorial](http://cssdeck.com/labs/learning-the-jade-templating-engine-syntax)
- cssdeck interactive [Pug logic tutorial](http://cssdeck.com/labs/jade-templating-tutorial-codecast-part-2)
- [Pug について。](https://gist.github.com/japboy/5402844) (A Japanese Tutorial)
Implementations in other languages:
- [Larpug - Pug for Laravel](https://github.com/acidjazz/larpug)
- [php](https://github.com/pug-php/pug)
- [scala](https://scalate.github.io/scalate/documentation/scaml-reference.html)
- [ruby](https://github.com/slim-template/slim)
- [python](https://github.com/SyrusAkbary/pyjade)
- [java](https://github.com/neuland/jade4j)
Other:
- [Emacs Mode](https://github.com/brianc/jade-mode)
- [Vim Syntax](https://github.com/digitaltoad/vim-pug)
- [TextMate Bundle](http://github.com/miksago/jade-tmbundle)
- [Coda/SubEtha syntax Mode](https://github.com/aaronmccall/jade.mode)
- [html2pug](https://github.com/donpark/html2jade) converter
- [pug2php](https://github.com/SE7ENSKY/jade2php) converter
- [Pug Server](https://github.com/ded/jade-server) Ideal for building local prototypes apart from any application
- [pug-ruby](https://github.com/yivo/pug-ruby) gem: Allows to invoke Pug and Jade from Ruby
- [pug-rails](https://github.com/yivo/pug-rails) gem: Integrates Pug and Jade into your Rails application
## License
MIT

5
node_modules/pug/examples/README.md generated vendored Normal file
View File

@@ -0,0 +1,5 @@
The examples in this directory can be run simply by something like.
node attributes.js
You can also open `browser.html` in a browser.

11
node_modules/pug/examples/attributes.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* Module dependencies.
*/
var pug = require('../')
, path = __dirname + '/attributes.pug'
, str = require('fs').readFileSync(path, 'utf8')
, fn = pug.compile(str, { filename: path, pretty: true });
console.log(fn({ name: 'tj' }));

8
node_modules/pug/examples/attributes.pug generated vendored Normal file
View File

@@ -0,0 +1,8 @@
div#id.left.container(class='user user-' + name)
h1.title= name
form
//- unbuffered comment :)
// An example of attributes.
input(type='text' name='user[name]' value=name)
input(checked, type='checkbox', name='user[blocked]')
input(type='submit', value='Update')

16
node_modules/pug/examples/code.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* Module dependencies.
*/
var pug = require('../')
, path = __dirname + '/code.pug'
, str = require('fs').readFileSync(path, 'utf8')
, fn = pug.compile(str, { filename: path, pretty: true });
var users = {
tj: { age: 23, email: 'tj@vision-media.ca', isA: 'human' },
tobi: { age: 1, email: 'tobi@is-amazing.com', isA: 'ferret' }
};
console.log(fn({ users: users }));

17
node_modules/pug/examples/code.pug generated vendored Normal file
View File

@@ -0,0 +1,17 @@
- var title = "Things"
-
var subtitle = ["Really", "long",
"list", "of",
"words"]
h1= title
h2= subtitle.join(" ")
ul#users
each user, name in users
// expands to if (user.isA == 'ferret')
if user.isA == 'ferret'
li(class='user-' + name) #{name} is just a ferret
else
li(class='user-' + name) #{name} #{user.email}

16
node_modules/pug/examples/dynamicscript.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* Module dependencies.
*/
var pug = require('../');
var locals = {
users: {
tj: { age: 23, email: 'tj@vision-media.ca', isA: 'human' },
tobi: { age: 1, email: 'tobi@is-amazing.com', isA: 'ferret' }
}
};
var fn = pug.compileFile(__dirname + '/dynamicscript.pug');
console.log(fn(locals));

5
node_modules/pug/examples/dynamicscript.pug generated vendored Normal file
View File

@@ -0,0 +1,5 @@
html
head
title Dynamic Inline JavaScript
script.
var users = !{JSON.stringify(users).replace(/<\//g, "<\\/")}

16
node_modules/pug/examples/each.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* Module dependencies.
*/
var pug = require('../')
, path = __dirname + '/each.pug'
, str = require('fs').readFileSync(path, 'utf8')
, fn = pug.compile(str, { filename: path, pretty: true });
var users = {
tj: { age: 23, email: 'tj@vision-media.ca', isA: 'human' },
tobi: { age: 1, email: 'tobi@is-amazing.com', isA: 'ferret' }
};
console.log(fn({ users: users }));

3
node_modules/pug/examples/each.pug generated vendored Normal file
View File

@@ -0,0 +1,3 @@
ul#users
each user, name in users
li(class='user-' + name) #{name} #{user.email}

10
node_modules/pug/examples/extend-layout.pug generated vendored Normal file
View File

@@ -0,0 +1,10 @@
html
head
h1 My Site - #{title}
block scripts
script(src='/jquery.js')
body
block content
block foot
#footer
p some footer content

18
node_modules/pug/examples/extend.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
/**
* Module dependencies.
*/
var pug = require('../')
, path = __dirname + '/extend.pug'
, str = require('fs').readFileSync(path, 'utf8')
, fn = pug.compile(str, { filename: path, pretty: true });
var tobi = { name: 'tobi', age: 2 };
var loki = { name: 'loki', age: 1 };
var jane = { name: 'jane', age: 5 };
console.log(fn({
title: 'pets'
, pets: [tobi, loki, jane]
}));

11
node_modules/pug/examples/extend.pug generated vendored Normal file
View File

@@ -0,0 +1,11 @@
extends extend-layout.pug
block scripts
script(src='/jquery.js')
script(src='/pets.js')
block content
h1= title
each pet in pets
include pet.pug

18
node_modules/pug/examples/form.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
/**
* Module dependencies.
*/
var pug = require('../')
, path = __dirname + '/form.pug'
, str = require('fs').readFileSync(path, 'utf8')
, fn = pug.compile(str, { filename: path, pretty: true });
var user = {
name: 'TJ',
email: 'tj@vision-media.ca',
city: 'Victoria',
province: 'BC'
};
console.log(fn({ user: user }));

29
node_modules/pug/examples/form.pug generated vendored Normal file
View File

@@ -0,0 +1,29 @@
form(method="post")
fieldset
legend General
p
label(for="user[name]") Username:
input(type="text", name="user[name]", value=user.name)
p
label(for="user[email]") Email:
input(type="text", name="user[email]", value=user.email)
.tip.
Enter a valid
email address
such as <em>tj@vision-media.ca</em>.
fieldset
legend Location
p
label(for="user[city]") City:
input(type="text", name="user[city]", value=user.city)
p
select(name="user[province]")
option(value="") -- Select Province --
option(value="AB") Alberta
option(value="BC") British Columbia
option(value="SK") Saskatchewan
option(value="MB") Manitoba
option(value="ON") Ontario
option(value="QC") Quebec
p.buttons
input(type="submit", value="Save")

11
node_modules/pug/examples/includes.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* Module dependencies.
*/
var pug = require('../')
, path = __dirname + '/includes.pug'
, str = require('fs').readFileSync(path, 'utf8')
, fn = pug.compile(str, { filename: path, pretty: true });
console.log(fn());

7
node_modules/pug/examples/includes.pug generated vendored Normal file
View File

@@ -0,0 +1,7 @@
html
include includes/head.pug
body
h1 My Site
p Welcome to my super lame site.
include includes/foot.pug

2
node_modules/pug/examples/includes/foot.pug generated vendored Normal file
View File

@@ -0,0 +1,2 @@
#footer
p Copyright (c) foobar

6
node_modules/pug/examples/includes/head.pug generated vendored Normal file
View File

@@ -0,0 +1,6 @@
head
title My Site
// including other pug works
include scripts.pug
// including .html, .css, etc works
include style.css

2
node_modules/pug/examples/includes/scripts.pug generated vendored Normal file
View File

@@ -0,0 +1,2 @@
script(src='/javascripts/jquery.js')
script(src='/javascripts/app.js')

5
node_modules/pug/examples/includes/style.css generated vendored Normal file
View File

@@ -0,0 +1,5 @@
<style>
body {
padding: 50px;
}
</style>

11
node_modules/pug/examples/layout-debug.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* Module dependencies.
*/
var pug = require('../');
pug.renderFile(__dirname + '/layout.pug', { debug: true }, function(err, html){
if (err) throw err;
console.log(html);
});

11
node_modules/pug/examples/layout.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* Module dependencies.
*/
var pug = require('../')
, path = __dirname + '/layout.pug'
, str = require('fs').readFileSync(path, 'utf8')
, fn = pug.compile(str, { filename: path, pretty: true });
console.log(fn());

14
node_modules/pug/examples/layout.pug generated vendored Normal file
View File

@@ -0,0 +1,14 @@
doctype html
html(lang="en")
head
title Example
script.
if (foo) {
bar();
}
body
h1 Pug - node template engine
#container
:markdown-it
Pug is a _high performance_ template engine for [node](http://nodejs.org),
inspired by [haml](http://haml-lang.com/), and written by [TJ Holowaychuk](http://github.com/visionmedia).

16
node_modules/pug/examples/mixins.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* Module dependencies.
*/
var pug = require('../')
, path = __dirname + '/mixins.pug'
, str = require('fs').readFileSync(path, 'utf8')
, fn = pug.compile(str, { filename: path, pretty: true });
var user = {
name: 'tj'
, pets: ['tobi', 'loki', 'jane', 'manny']
};
console.log(fn({ user: user }));

14
node_modules/pug/examples/mixins.pug generated vendored Normal file
View File

@@ -0,0 +1,14 @@
include mixins/dialog.pug
include mixins/profile.pug
.one
+dialog
.two
+dialog-title('Whoop')
.three
+dialog-title-desc('Whoop', 'Just a mixin')
#profile
+profile(user)

15
node_modules/pug/examples/mixins/dialog.pug generated vendored Normal file
View File

@@ -0,0 +1,15 @@
mixin dialog
.dialog
h1 Whoop
p stuff
mixin dialog-title(title)
.dialog
h1= title
p stuff
mixin dialog-title-desc(title, desc)
.dialog
h1= title
p= desc

10
node_modules/pug/examples/mixins/profile.pug generated vendored Normal file
View File

@@ -0,0 +1,10 @@
mixin pets(pets)
ul.pets
each pet in pets
li= pet
mixin profile(user)
.user
h2= user.name
+pets(user.pets)

3
node_modules/pug/examples/pet.pug generated vendored Normal file
View File

@@ -0,0 +1,3 @@
.pet
h2= pet.name
p #{pet.name} is <em>#{pet.age}</em> year(s) old.

17
node_modules/pug/examples/rss.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
/**
* Module dependencies.
*/
var pug = require('../')
, path = __dirname + '/rss.pug'
, str = require('fs').readFileSync(path, 'utf8')
, fn = pug.compile(str, { filename: path, pretty: true });
var items = [];
items.push({ title: 'Example', description: 'Something', link: 'http://google.com' });
items.push({ title: 'LearnBoost', description: 'Cool', link: 'http://learnboost.com' });
items.push({ title: 'Express', description: 'Cool', link: 'http://expressjs.com' });
console.log(fn({ items: items }));

14
node_modules/pug/examples/rss.pug generated vendored Normal file
View File

@@ -0,0 +1,14 @@
doctype xml
rss(version='2.0')
channel
title RSS Title
description Some description here
link http://google.com
lastBuildDate Mon, 06 Sep 2010 00:01:00 +0000
pubDate Mon, 06 Sep 2009 16:45:00 +0000
each item in items
item
title= item.title
description= item.description
link= item.link

11
node_modules/pug/examples/text.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* Module dependencies.
*/
var pug = require('../')
, path = __dirname + '/text.pug'
, str = require('fs').readFileSync(path, 'utf8')
, fn = pug.compile(str, { filename: path, pretty: true });
console.log(fn({ name: 'tj', email: 'tj@vision-media.ca' }));

36
node_modules/pug/examples/text.pug generated vendored Normal file
View File

@@ -0,0 +1,36 @@
| An example of an
a(href='#') inline
| link.
form
label Username:
input(type='text', name='user[name]')
p
| Just an example of some text usage.
| You can have <em>inline</em> html,
| as well as
strong tags
| .
| Interpolation is also supported. The
| username is currently "#{name}".
label Email:
input(type='text', name='user[email]')
p
| Email is currently
em= email
| .
// alternatively, if we plan on having only
// text or inline-html, we can use a trailing
// "." to let pug know we want to omit pipes
label Username:
input(type='text')
p.
Just an example, like before
however now we can omit those
annoying pipes!.
Wahoo.

11
node_modules/pug/examples/whitespace.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* Module dependencies.
*/
var pug = require('../')
, path = __dirname + '/whitespace.pug'
, str = require('fs').readFileSync(path, 'utf8')
, fn = pug.compile(str, { filename: path, pretty: true });
console.log(fn());

11
node_modules/pug/examples/whitespace.pug generated vendored Normal file
View File

@@ -0,0 +1,11 @@
- var js = '<script></script>'
doctype html
html
head
title= "Some " + "JavaScript"
!= js
body

465
node_modules/pug/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,465 @@
'use strict';
/*!
* Pug
* Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var fs = require('fs');
var path = require('path');
var lex = require('pug-lexer');
var stripComments = require('pug-strip-comments');
var parse = require('pug-parser');
var load = require('pug-load');
var filters = require('pug-filters');
var link = require('pug-linker');
var generateCode = require('pug-code-gen');
var runtime = require('pug-runtime');
var runtimeWrap = require('pug-runtime/wrap');
/**
* Name for detection
*/
exports.name = 'Pug';
/**
* Pug runtime helpers.
*/
exports.runtime = runtime;
/**
* Template function cache.
*/
exports.cache = {};
function applyPlugins(value, options, plugins, name) {
return plugins.reduce(function (value, plugin) {
return (
plugin[name]
? plugin[name](value, options)
: value
);
}, value);
}
function findReplacementFunc(plugins, name) {
var eligiblePlugins = plugins.filter(function (plugin) {
return plugin[name];
});
if (eligiblePlugins.length > 1) {
throw new Error('Two or more plugins all implement ' + name + ' method.');
} else if (eligiblePlugins.length) {
return eligiblePlugins[0][name].bind(eligiblePlugins[0]);
}
return null;
}
/**
* Object for global custom filters. Note that you can also just pass a `filters`
* option to any other method.
*/
exports.filters = {};
/**
* Compile the given `str` of pug and return a function body.
*
* @param {String} str
* @param {Object} options
* @return {Object}
* @api private
*/
function compileBody(str, options){
var debug_sources = {};
debug_sources[options.filename] = str;
var dependencies = [];
var plugins = options.plugins || [];
var ast = load.string(str, {
filename: options.filename,
basedir: options.basedir,
lex: function (str, options) {
var lexOptions = {};
Object.keys(options).forEach(function (key) {
lexOptions[key] = options[key];
});
lexOptions.plugins = plugins.filter(function (plugin) {
return !!plugin.lex;
}).map(function (plugin) {
return plugin.lex;
});
return applyPlugins(lex(str, lexOptions), options, plugins, 'postLex');
},
parse: function (tokens, options) {
tokens = tokens.map(function (token) {
if (token.type === 'path' && path.extname(token.val) === '') {
return {
type: 'path',
loc: token.loc,
val: token.val + '.pug'
};
}
return token;
});
tokens = stripComments(tokens, options);
tokens = applyPlugins(tokens, options, plugins, 'preParse');
var parseOptions = {};
Object.keys(options).forEach(function (key) {
parseOptions[key] = options[key];
});
parseOptions.plugins = plugins.filter(function (plugin) {
return !!plugin.parse;
}).map(function (plugin) {
return plugin.parse;
});
return applyPlugins(
applyPlugins(parse(tokens, parseOptions), options, plugins, 'postParse'),
options, plugins, 'preLoad'
);
},
resolve: function (filename, source, loadOptions) {
var replacementFunc = findReplacementFunc(plugins, 'resolve');
if (replacementFunc) {
return replacementFunc(filename, source, options);
}
return load.resolve(filename, source, loadOptions);
},
read: function (filename, loadOptions) {
dependencies.push(filename);
var contents;
var replacementFunc = findReplacementFunc(plugins, 'read');
if (replacementFunc) {
contents = replacementFunc(filename, options);
} else {
contents = load.read(filename, loadOptions);
}
var str = applyPlugins(contents, {filename: filename}, plugins, 'preLex');
debug_sources[filename] = str;
return str;
}
});
ast = applyPlugins(ast, options, plugins, 'postLoad');
ast = applyPlugins(ast, options, plugins, 'preFilters');
var filtersSet = {};
Object.keys(exports.filters).forEach(function (key) {
filtersSet[key] = exports.filters[key];
});
if (options.filters) {
Object.keys(options.filters).forEach(function (key) {
filtersSet[key] = options.filters[key];
});
}
ast = filters.handleFilters(ast, filtersSet, options.filterOptions, options.filterAliases);
ast = applyPlugins(ast, options, plugins, 'postFilters');
ast = applyPlugins(ast, options, plugins, 'preLink');
ast = link(ast);
ast = applyPlugins(ast, options, plugins, 'postLink');
// Compile
ast = applyPlugins(ast, options, plugins, 'preCodeGen');
var js = generateCode(ast, {
pretty: options.pretty,
compileDebug: options.compileDebug,
doctype: options.doctype,
inlineRuntimeFunctions: options.inlineRuntimeFunctions,
globals: options.globals,
self: options.self,
includeSources: options.includeSources ? debug_sources : false,
templateName: options.templateName
});
js = applyPlugins(js, options, plugins, 'postCodeGen');
// Debug compiler
if (options.debug) {
console.error('\nCompiled Function:\n\n\u001b[90m%s\u001b[0m', js.replace(/^/gm, ' '));
}
return {body: js, dependencies: dependencies};
}
/**
* Get the template from a string or a file, either compiled on-the-fly or
* read from cache (if enabled), and cache the template if needed.
*
* If `str` is not set, the file specified in `options.filename` will be read.
*
* If `options.cache` is true, this function reads the file from
* `options.filename` so it must be set prior to calling this function.
*
* @param {Object} options
* @param {String=} str
* @return {Function}
* @api private
*/
function handleTemplateCache (options, str) {
var key = options.filename;
if (options.cache && exports.cache[key]) {
return exports.cache[key];
} else {
if (str === undefined) str = fs.readFileSync(options.filename, 'utf8');
var templ = exports.compile(str, options);
if (options.cache) exports.cache[key] = templ;
return templ;
}
}
/**
* Compile a `Function` representation of the given pug `str`.
*
* Options:
*
* - `compileDebug` when `false` debugging code is stripped from the compiled
template, when it is explicitly `true`, the source code is included in
the compiled template for better accuracy.
* - `filename` used to improve errors when `compileDebug` is not `false` and to resolve imports/extends
*
* @param {String} str
* @param {Options} options
* @return {Function}
* @api public
*/
exports.compile = function(str, options){
var options = options || {}
str = String(str);
var parsed = compileBody(str, {
compileDebug: options.compileDebug !== false,
filename: options.filename,
basedir: options.basedir,
pretty: options.pretty,
doctype: options.doctype,
inlineRuntimeFunctions: options.inlineRuntimeFunctions,
globals: options.globals,
self: options.self,
includeSources: options.compileDebug === true,
debug: options.debug,
templateName: 'template',
filters: options.filters,
filterOptions: options.filterOptions,
filterAliases: options.filterAliases,
plugins: options.plugins,
});
var res = options.inlineRuntimeFunctions
? new Function('', parsed.body + ';return template;')()
: runtimeWrap(parsed.body);
res.dependencies = parsed.dependencies;
return res;
};
/**
* Compile a JavaScript source representation of the given pug `str`.
*
* Options:
*
* - `compileDebug` When it is `true`, the source code is included in
* the compiled template for better error messages.
* - `filename` used to improve errors when `compileDebug` is not `true` and to resolve imports/extends
* - `name` the name of the resulting function (defaults to "template")
* - `module` when it is explicitly `true`, the source code include export module syntax
*
* @param {String} str
* @param {Options} options
* @return {Object}
* @api public
*/
exports.compileClientWithDependenciesTracked = function(str, options){
var options = options || {};
str = String(str);
var parsed = compileBody(str, {
compileDebug: options.compileDebug,
filename: options.filename,
basedir: options.basedir,
pretty: options.pretty,
doctype: options.doctype,
inlineRuntimeFunctions: options.inlineRuntimeFunctions !== false,
globals: options.globals,
self: options.self,
includeSources: options.compileDebug,
debug: options.debug,
templateName: options.name || 'template',
filters: options.filters,
filterOptions: options.filterOptions,
filterAliases: options.filterAliases,
plugins: options.plugins
});
var body = parsed.body;
if(options.module) {
if(options.inlineRuntimeFunctions === false) {
body = 'var pug = require("pug-runtime");' + body;
}
body += ' module.exports = ' + (options.name || 'template') + ';';
}
return {body: body, dependencies: parsed.dependencies};
};
/**
* Compile a JavaScript source representation of the given pug `str`.
*
* Options:
*
* - `compileDebug` When it is `true`, the source code is included in
* the compiled template for better error messages.
* - `filename` used to improve errors when `compileDebug` is not `true` and to resolve imports/extends
* - `name` the name of the resulting function (defaults to "template")
*
* @param {String} str
* @param {Options} options
* @return {String}
* @api public
*/
exports.compileClient = function (str, options) {
return exports.compileClientWithDependenciesTracked(str, options).body;
};
/**
* Compile a `Function` representation of the given pug file.
*
* Options:
*
* - `compileDebug` when `false` debugging code is stripped from the compiled
template, when it is explicitly `true`, the source code is included in
the compiled template for better accuracy.
*
* @param {String} path
* @param {Options} options
* @return {Function}
* @api public
*/
exports.compileFile = function (path, options) {
options = options || {};
options.filename = path;
return handleTemplateCache(options);
};
/**
* Render the given `str` of pug.
*
* Options:
*
* - `cache` enable template caching
* - `filename` filename required for `include` / `extends` and caching
*
* @param {String} str
* @param {Object|Function} options or fn
* @param {Function|undefined} fn
* @returns {String}
* @api public
*/
exports.render = function(str, options, fn){
// support callback API
if ('function' == typeof options) {
fn = options, options = undefined;
}
if (typeof fn === 'function') {
var res;
try {
res = exports.render(str, options);
} catch (ex) {
return fn(ex);
}
return fn(null, res);
}
options = options || {};
// cache requires .filename
if (options.cache && !options.filename) {
throw new Error('the "filename" option is required for caching');
}
return handleTemplateCache(options, str)(options);
};
/**
* Render a Pug file at the given `path`.
*
* @param {String} path
* @param {Object|Function} options or callback
* @param {Function|undefined} fn
* @returns {String}
* @api public
*/
exports.renderFile = function(path, options, fn){
// support callback API
if ('function' == typeof options) {
fn = options, options = undefined;
}
if (typeof fn === 'function') {
var res;
try {
res = exports.renderFile(path, options);
} catch (ex) {
return fn(ex);
}
return fn(null, res);
}
options = options || {};
options.filename = path;
return handleTemplateCache(options)(options);
};
/**
* Compile a Pug file at the given `path` for use on the client.
*
* @param {String} path
* @param {Object} options
* @returns {String}
* @api public
*/
exports.compileFileClient = function(path, options){
var key = path + ':client';
options = options || {};
options.filename = path;
if (options.cache && exports.cache[key]) {
return exports.cache[key];
}
var str = fs.readFileSync(options.filename, 'utf8');
var out = exports.compileClient(str, options);
if (options.cache) exports.cache[key] = out;
return out;
};
/**
* Express support.
*/
exports.__express = function(path, options, fn) {
if(options.compileDebug == undefined && process.env.NODE_ENV === 'production') {
options.compileDebug = false;
}
exports.renderFile(path, options, fn);
}

104
node_modules/pug/package.json generated vendored Normal file
View File

@@ -0,0 +1,104 @@
{
"_from": "pug@2.0.3",
"_id": "pug@2.0.3",
"_inBundle": false,
"_integrity": "sha1-ccuoJTfJWl6rftBGluQiH1Oqh44=",
"_location": "/pug",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "pug@2.0.3",
"name": "pug",
"escapedName": "pug",
"rawSpec": "2.0.3",
"saveSpec": null,
"fetchSpec": "2.0.3"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/pug/-/pug-2.0.3.tgz",
"_shasum": "71cba82537c95a5eab7ed04696e4221f53aa878e",
"_spec": "pug@2.0.3",
"_where": "/Users/rxf/WebstormProjects/laufschrift",
"author": {
"name": "TJ Holowaychuk",
"email": "tj@vision-media.ca"
},
"browser": {
"fs": false
},
"bugs": {
"url": "https://github.com/pugjs/pug/issues"
},
"bundleDependencies": false,
"dependencies": {
"pug-code-gen": "^2.0.1",
"pug-filters": "^3.1.0",
"pug-lexer": "^4.0.0",
"pug-linker": "^3.0.5",
"pug-load": "^2.0.11",
"pug-parser": "^5.0.0",
"pug-runtime": "^2.0.4",
"pug-strip-comments": "^1.0.3"
},
"deprecated": false,
"description": "A clean, whitespace-sensitive template language for writing HTML",
"devDependencies": {
"jstransformer-cdata": "^1.0.0",
"jstransformer-coffee-script": "^1.0.0",
"jstransformer-less": "^2.1.0",
"jstransformer-markdown-it": "^1.0.0",
"jstransformer-stylus": "^1.0.0",
"jstransformer-uglify-js": "^1.1.1",
"jstransformer-verbatim": "^1.0.0",
"mkdirp": "^0.5.1",
"rimraf": "^2.2.8",
"uglify-js": "github:mishoo/UglifyJS2#1c15d0db456ce32f1b9b507aad97e5ee5c8285f7"
},
"homepage": "https://pugjs.org",
"license": "MIT",
"main": "lib",
"maintainers": [
{
"name": "Forbes Lindesay",
"email": "forbes@lindesay.co.uk"
},
{
"name": "Matthias Le Brun",
"email": "mlbli@me.com"
},
{
"name": "Joshua Appelman",
"email": "joshua@jbna.nl"
},
{
"name": "Jonathan Ong",
"email": "jonathanrichardong@gmail.com"
},
{
"name": "Alex Kocharin",
"email": "alex@kocharin.ru"
},
{
"name": "Hemanth",
"email": "hemanth.hm@gmail.com"
},
{
"name": "Timothy Gu",
"email": "timothygu99@gmail.com"
},
{
"name": "Andreas Lubbe",
"email": "git@lubbe.org"
}
],
"name": "pug",
"repository": {
"type": "git",
"url": "git://github.com/pugjs/pug.git"
},
"version": "2.0.3"
}

13
node_modules/pug/register.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
var pug = require('./');
var resolvedPug = JSON.stringify(require.resolve('./'));
function compileTemplate(module, filename) {
var template = pug.compileFileClient(filename, {inlineRuntimeFunctions: false});
var body = "var pug = require(" + resolvedPug + ").runtime;\n\n" +
"module.exports = " + template + ";";
module._compile(body, filename);
}
if (require.extensions) {
require.extensions['.pug'] = compileTemplate
};

121
node_modules/pug/support/benchmark.js generated vendored Normal file
View File

@@ -0,0 +1,121 @@
/**
* Module dependencies.
*/
var uubench = require('uubench')
, pug = require('../');
var suite = new uubench.Suite({
min: 200,
result: function(name, stats){
var persec = 1000 / stats.elapsed
, ops = stats.iterations * persec;
console.log('%s: %d', name, ops | 0);
}
});
function setup(self) {
var suffix = self ? ' (self)' : ''
, options = { self: self };
var str = 'html\n body\n h1 Title'
, fn = pug.compile(str, options);
suite.bench('tiny' + suffix, function(next){
fn();
next();
});
str = '\
html\n\
body\n\
h1 Title\n\
ul#menu\n\
li: a(href="#") Home\n\
li: a(href="#") About Us\n\
li: a(href="#") Store\n\
li: a(href="#") FAQ\n\
li: a(href="#") Contact\n\
';
var fn2 = pug.compile(str, options);
suite.bench('small' + suffix, function(next){
fn2();
next();
});
str = '\
html\n\
body\n\
h1 #{title}\n\
ul#menu\n\
- each link in links\r\n\
li: a(href="#")= link\r\n\
';
if (self) {
str = '\
html\n\
body\n\
h1 #{self.title}\n\
ul#menu\n\
- each link in self.links\r\n\
li: a(href="#")= link\r\n\
';
}
var fn3 = pug.compile(str, options);
suite.bench('small locals' + suffix, function(next){
fn3({ title: 'Title', links: ['Home', 'About Us', 'Store', 'FAQ', 'Contact'] });
next();
});
str = '\
html\n\
body\n\
h1 Title\n\
ul#menu\n\
li: a(href="#") Home\n\
li: a(href="#") About Us\n\
li: a(href="#") Store\n\
li: a(href="#") FAQ\n\
li: a(href="#") Contact\n\
';
str = Array(30).join(str);
var fn4 = pug.compile(str, options);
suite.bench('medium' + suffix, function(next){
fn4();
next();
});
str = '\
html\n\
body\n\
h1 Title\n\
ul#menu\n\
li: a(href="#") Home\n\
li: a(href="#") About Us\n\
li: a(href="#") Store\n\
li: a(href="#") FAQ\n\
li: a(href="#") Contact\n\
';
str = Array(100).join(str);
var fn5 = pug.compile(str, options);
suite.bench('large' + suffix, function(next){
fn5();
next();
});
}
setup();
setup(true);
suite.run();

15
node_modules/pug/test/README.md generated vendored Normal file
View File

@@ -0,0 +1,15 @@
# Running Tests
To run tests (with node.js installed) you must complete 2 steps.
## 1 Install dependencies
```
npm install
```
## 2 Run tests
```
npm test
```

102
node_modules/pug/test/__snapshots__/pug.test.js.snap generated vendored Normal file
View File

@@ -0,0 +1,102 @@
exports[`pug .compileClient() should support module syntax in pug.compileClient(str, options) when inlineRuntimeFunctions it false 1`] = `
"var pug = require(\"pug-runtime\");
function template(locals) {
var pug_html = \"\",
pug_mixins = {},
pug_interp;
var pug_debug_filename, pug_debug_line;
try {
var self = locals || {};
pug_debug_line = 1;
pug_html = pug_html + \'\\u003Cdiv class=\"bar\"\\u003E\';
pug_debug_line = 1;
pug_html =
pug_html +
pug.escape(null == (pug_interp = self.foo) ? \"\" : pug_interp) +
\"\\u003C\\u002Fdiv\\u003E\";
} catch (err) {
pug.rethrow(err, pug_debug_filename, pug_debug_line);
}
return pug_html;
}
module.exports = template;
"
`;
exports[`pug .compileClient() should support module syntax in pug.compileClient(str, options) when inlineRuntimeFunctions it true 1`] = `
"function pug_escape(e) {
var a = \"\" + e,
t = pug_match_html.exec(a);
if (!t) return e;
var r,
c,
n,
s = \"\";
for (r = t.index, c = 0; r < a.length; r++) {
switch (a.charCodeAt(r)) {
case 34:
n = \"&quot;\";
break;
case 38:
n = \"&amp;\";
break;
case 60:
n = \"&lt;\";
break;
case 62:
n = \"&gt;\";
break;
default:
continue;
}
c !== r && (s += a.substring(c, r)), (c = r + 1), (s += n);
}
return c !== r ? s + a.substring(c, r) : s;
}
var pug_match_html = /[\"&<>]/;
function pug_rethrow(n, e, r, t) {
if (!(n instanceof Error)) throw n;
if (!((\"undefined\" == typeof window && e) || t))
throw ((n.message += \" on line \" + r), n);
try {
t = t || require(\"fs\").readFileSync(e, \"utf8\");
} catch (e) {
pug_rethrow(n, null, r);
}
var i = 3,
a = t.split(\"\\n\"),
o = Math.max(r - i, 0),
h = Math.min(a.length, r + i),
i = a
.slice(o, h)
.map(function(n, e) {
var t = e + o + 1;
return (t == r ? \" > \" : \" \") + t + \"| \" + n;
})
.join(\"\\n\");
throw ((n.path = e),
(n.message = (e || \"Pug\") + \":\" + r + \"\\n\" + i + \"\\n\\n\" + n.message),
n);
}
function template(locals) {
var pug_html = \"\",
pug_mixins = {},
pug_interp;
var pug_debug_filename, pug_debug_line;
try {
var self = locals || {};
pug_debug_line = 1;
pug_html = pug_html + \'\\u003Cdiv class=\"bar\"\\u003E\';
pug_debug_line = 1;
pug_html =
pug_html +
pug_escape(null == (pug_interp = self.foo) ? \"\" : pug_interp) +
\"\\u003C\\u002Fdiv\\u003E\";
} catch (err) {
pug_rethrow(err, pug_debug_filename, pug_debug_line);
}
return pug_html;
}
module.exports = template;
"
`;

3
node_modules/pug/test/anti-cases/attrs.unescaped.pug generated vendored Normal file
View File

@@ -0,0 +1,3 @@
script(type='text/x-template')
#user(id!='user-<%= user.id %>')
h1 <%= user.title %>

4
node_modules/pug/test/anti-cases/case-when.pug generated vendored Normal file
View File

@@ -0,0 +1,4 @@
when 5
.foo
when 6
.bar

View File

@@ -0,0 +1,2 @@
case foo
.div

4
node_modules/pug/test/anti-cases/else-condition.pug generated vendored Normal file
View File

@@ -0,0 +1,4 @@
if foo
div
else bar
article

2
node_modules/pug/test/anti-cases/else-without-if.pug generated vendored Normal file
View File

@@ -0,0 +1,2 @@
else
.foo

View File

@@ -0,0 +1 @@
foo()+bar()

View File

@@ -0,0 +1 @@
div("foo"abc)

View File

@@ -0,0 +1 @@
div(foo!~abc)

View File

@@ -0,0 +1,2 @@
//- #1871
p #[strong a}

View File

@@ -0,0 +1,2 @@
mixin foo(a, b)
+foo('a'b'b')

View File

@@ -0,0 +1,3 @@
mixin foo
block
bar

View File

@@ -0,0 +1 @@
foo()bar

View File

@@ -0,0 +1,2 @@
:not-a-valid-filter
foo bar

2
node_modules/pug/test/anti-cases/non-mixin-block.pug generated vendored Normal file
View File

@@ -0,0 +1,2 @@
div
block

View File

@@ -0,0 +1 @@
div(title=[)

1
node_modules/pug/test/anti-cases/readme.md generated vendored Normal file
View File

@@ -0,0 +1 @@
This folder collects examples of files that are not valid `pug`, but were at some point accepted by the parser without throwing an error. The tests ensure that all these cases now throw some form of error message (hopefully a helpful one).

View File

@@ -0,0 +1,2 @@
input
| Inputs cannot have content

View File

@@ -0,0 +1 @@
input Input's can't have content

View File

@@ -0,0 +1 @@
input= 'Inputs cannot have code'

3
node_modules/pug/test/anti-cases/tabs-and-spaces.pug generated vendored Normal file
View File

@@ -0,0 +1,3 @@
div
div
article

View File

@@ -0,0 +1 @@
+#{myMixin

View File

@@ -0,0 +1,4 @@
mixin item
block
+item( Contact

View File

@@ -0,0 +1 @@
#{myMixin

10
node_modules/pug/test/browser/index.html generated vendored Normal file
View File

@@ -0,0 +1,10 @@
<!DOCTYPE html><html><head></head><body><textarea id="input" placeholder="write pug here" style="width: 100%; min-height: 400px;">p
author
!= myName</textarea><pre style="background: #ECECEC;width: 100%; min-height: 400px;"><code id="output"></code></pre><script src="../../pug.js"></script><script>var input = document.getElementById('input');
var output = document.getElementById('output');
setInterval(function () {
pug.render(input.value, {myName: 'Forbes Lindesay', pretty: true}, function (err, res) {
if (err) throw err;
output.textContent = res;
})
}, 500)</script></body></html>

20
node_modules/pug/test/browser/index.pug generated vendored Normal file
View File

@@ -0,0 +1,20 @@
!!! 5
html
head
body
textarea#input(placeholder='write pug here', style='width: 100%; min-height: 400px;').
p
author
!= myName
pre(style='background: #ECECEC;width: 100%; min-height: 400px;')
code#output
script(src='../../pug.js')
script.
var input = document.getElementById('input');
var output = document.getElementById('output');
setInterval(function () {
pug.render(input.value, {myName: 'Forbes Lindesay', pretty: true}, function (err, res) {
if (err) throw err;
output.textContent = res;
})
}, 500)

1
node_modules/pug/test/cases-es2015/attr.html generated vendored Normal file
View File

@@ -0,0 +1 @@
<div class="avatar-div" style="background-image: url(https://www.gravatar.com/avatar/219b77f9d21de75e81851b6b886057c7)"></div>

3
node_modules/pug/test/cases-es2015/attr.pug generated vendored Normal file
View File

@@ -0,0 +1,3 @@
- var avatar = '219b77f9d21de75e81851b6b886057c7'
div.avatar-div(style=`background-image: url(https://www.gravatar.com/avatar/${avatar})`)

6
node_modules/pug/test/cases/attrs-data.html generated vendored Normal file
View File

@@ -0,0 +1,6 @@
<foo data-user="{&quot;name&quot;:&quot;tobi&quot;}"></foo>
<foo data-items="[1,2,3]"></foo>
<foo data-username="tobi"></foo>
<foo data-escaped="{&quot;message&quot;:&quot;Let's rock!&quot;}"></foo>
<foo data-ampersand="{&quot;message&quot;:&quot;a quote: &amp;quot; this &amp; that&quot;}"></foo>
<foo data-epoc="1970-01-01T00:00:00.000Z"></foo>

7
node_modules/pug/test/cases/attrs-data.pug generated vendored Normal file
View File

@@ -0,0 +1,7 @@
- var user = { name: 'tobi' }
foo(data-user=user)
foo(data-items=[1,2,3])
foo(data-username='tobi')
foo(data-escaped={message: "Let's rock!"})
foo(data-ampersand={message: "a quote: &quot; this & that"})
foo(data-epoc=new Date(0))

1
node_modules/pug/test/cases/attrs.colon.html generated vendored Normal file
View File

@@ -0,0 +1 @@
<div :my-var="model"></div><span v-for="item in items" :key="item.id" :value="item.name"></span><span v-for="item in items" :key="item.id" :value="item.name"></span><a :link="goHere" value="static" :my-value="dynamic" @click="onClick()" :another="more">Click Me!</a>

9
node_modules/pug/test/cases/attrs.colon.pug generated vendored Normal file
View File

@@ -0,0 +1,9 @@
//- Tests for using a colon-prefexed attribute (typical when using short-cut for Vue.js `v-bind`)
div(:my-var="model")
span(v-for="item in items" :key="item.id" :value="item.name")
span(
v-for="item in items"
:key="item.id"
:value="item.name"
)
a(:link="goHere" value="static" :my-value="dynamic" @click="onClick()" :another="more") Click Me!

20
node_modules/pug/test/cases/attrs.html generated vendored Normal file
View File

@@ -0,0 +1,20 @@
<a href="/contact">contact</a><a class="button" href="/save">save</a><a foo="foo" bar="bar" baz="baz"></a><a foo="foo, bar, baz" bar="1"></a><a foo="((foo))" bar="1"></a>
<select>
<option value="foo" selected="selected">Foo</option>
<option selected="selected" value="bar">Bar</option>
</select><a foo="class:"></a>
<input pattern="\S+"/><a href="/contact">contact</a><a class="button" href="/save">save</a><a foo="foo" bar="bar" baz="baz"></a><a foo="foo, bar, baz" bar="1"></a><a foo="((foo))" bar="1"></a>
<select>
<option value="foo" selected="selected">Foo</option>
<option selected="selected" value="bar">Bar</option>
</select><a foo="class:"></a>
<input pattern="\S+"/>
<foo terse="true"></foo>
<foo date="1970-01-01T00:00:00.000Z"></foo>
<foo abc="abc" def="def"></foo>
<foo abc="abc" def="def"></foo>
<foo abc="abc" def="def"></foo>
<foo abc="abc" def="def"></foo>
<foo abc="abc" def="def"></foo>
<foo abc="abc" def="def"></foo>
<div foo="bar" bar="<baz>"></div><a foo="foo" bar="bar"></a><a foo="foo" bar="bar"></a>

5
node_modules/pug/test/cases/attrs.js.html generated vendored Normal file
View File

@@ -0,0 +1,5 @@
<a class="button" href="/user/5"></a><a class="button" href="/user/5"></a>
<meta key="answer" value="42"/><a class="class1 class2"></a><a class="tag-class class1 class2"></a><a class="button" href="/user/5"></a><a class="button" href="/user/5"></a>
<meta key="answer" value="42"/><a class="class1 class2"></a><a class="tag-class class1 class2"></a>
<div id="5" foo="bar"></div>
<div baz="baz"></div>

17
node_modules/pug/test/cases/attrs.js.pug generated vendored Normal file
View File

@@ -0,0 +1,17 @@
- var id = 5
- function answer() { return 42; }
a(href='/user/' + id, class='button')
a(href = '/user/' + id, class = 'button')
meta(key='answer', value=answer())
a(class = ['class1', 'class2'])
a.tag-class(class = ['class1', 'class2'])
a(href='/user/' + id class='button')
a(href = '/user/' + id class = 'button')
meta(key='answer' value=answer())
a(class = ['class1', 'class2'])
a.tag-class(class = ['class1', 'class2'])
div(id=id)&attributes({foo: 'bar'})
- var bar = null
div(foo=null bar=bar)&attributes({baz: 'baz'})

43
node_modules/pug/test/cases/attrs.pug generated vendored Normal file
View File

@@ -0,0 +1,43 @@
a(href='/contact') contact
a(href='/save').button save
a(foo, bar, baz)
a(foo='foo, bar, baz', bar=1)
a(foo='((foo))', bar= (1) ? 1 : 0 )
select
option(value='foo', selected) Foo
option(selected, value='bar') Bar
a(foo="class:")
input(pattern='\\S+')
a(href='/contact') contact
a(href='/save').button save
a(foo bar baz)
a(foo='foo, bar, baz' bar=1)
a(foo='((foo))' bar= (1) ? 1 : 0 )
select
option(value='foo' selected) Foo
option(selected value='bar') Bar
a(foo="class:")
input(pattern='\\S+')
foo(terse="true")
foo(date=new Date(0))
foo(abc
,def)
foo(abc,
def)
foo(abc,
def)
foo(abc
,def)
foo(abc
def)
foo(abc
def)
- var attrs = {foo: 'bar', bar: '<baz>'}
div&attributes(attrs)
a(foo='foo' "bar"="bar")
a(foo='foo' 'bar'='bar')

5
node_modules/pug/test/cases/attrs.unescaped.html generated vendored Normal file
View File

@@ -0,0 +1,5 @@
<script type="text/x-template">
<div id="user-<%= user.id %>">
<h1><%= user.title %></h1>
</div>
</script>

3
node_modules/pug/test/cases/attrs.unescaped.pug generated vendored Normal file
View File

@@ -0,0 +1,3 @@
script(type='text/x-template')
div(id!='user-<%= user.id %>')
h1 <%= user.title %>

View File

@@ -0,0 +1 @@
block content

View File

@@ -0,0 +1,4 @@
mixin test()
.test&attributes(attributes)
+test()

View File

@@ -0,0 +1,8 @@
doctype html
html
head
title Default title
body
block body
.container
block content

6
node_modules/pug/test/cases/auxiliary/dialog.pug generated vendored Normal file
View File

@@ -0,0 +1,6 @@
extends window.pug
block window-content
.dialog
block content

View File

@@ -0,0 +1,2 @@
block test

3
node_modules/pug/test/cases/auxiliary/escapes.html generated vendored Normal file
View File

@@ -0,0 +1,3 @@
<script>
console.log("foo\nbar")
</script>

View File

@@ -0,0 +1,5 @@
extends empty-block.pug
block test
div test1

View File

@@ -0,0 +1,5 @@
extends empty-block.pug
block test
div test2

View File

@@ -0,0 +1,4 @@
extends /auxiliary/layout.pug
block content
include /auxiliary/include-from-root.pug

View File

@@ -0,0 +1,4 @@
extends ../../cases/auxiliary/layout
block content
include ../../cases/auxiliary/include-from-root

View File

@@ -0,0 +1,8 @@
html
head
style(type="text/css")
:less
@pad: 15px;
body {
padding: @pad;
}

7
node_modules/pug/test/cases/auxiliary/includable.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
var STRING_SUBSTITUTIONS = { // table of character substitutions
'\t': '\\t',
'\r': '\\r',
'\n': '\\n',
'"' : '\\"',
'\\': '\\\\'
};

View File

@@ -0,0 +1 @@
h1 hello

View File

@@ -0,0 +1,11 @@
mixin article()
article
block
html
head
title My Application
block head
body
+article
block content

View File

@@ -0,0 +1,2 @@
h1 grand-grandparent
block grand-grandparent

View File

@@ -0,0 +1,6 @@
extends inheritance.extend.recursive-grand-grandparent.pug
block grand-grandparent
h2 grandparent
block grandparent

View File

@@ -0,0 +1,5 @@
extends inheritance.extend.recursive-grandparent.pug
block grandparent
h3 parent
block parent

View File

@@ -0,0 +1,7 @@
html
head
title My Application
block head
body
block content
include window.pug

6
node_modules/pug/test/cases/auxiliary/layout.pug generated vendored Normal file
View File

@@ -0,0 +1,6 @@
html
head
title My Application
block head
body
block content

View File

@@ -0,0 +1,3 @@
mixin slide
section.slide
block

Some files were not shown because too many files have changed in this diff Show More