Showing preview only (2,989K chars total). Download the full file or copy to clipboard to get everything.
Repository: pugjs/pug
Branch: master
Commit: c323ed3e630b
Files: 912
Total size: 2.7 MB
Directory structure:
gitextract_f46w__89/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE.md
│ └── workflows/
│ ├── rollingversions.yml
│ └── test.yml
├── .gitignore
├── .prettierrc.js
├── README.md
├── SECURITY.md
├── package.json
├── packages/
│ ├── pug/
│ │ ├── History.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── examples/
│ │ │ ├── README.md
│ │ │ ├── attributes.js
│ │ │ ├── attributes.pug
│ │ │ ├── code.js
│ │ │ ├── code.pug
│ │ │ ├── dynamicscript.js
│ │ │ ├── dynamicscript.pug
│ │ │ ├── each.js
│ │ │ ├── each.pug
│ │ │ ├── extend-layout.pug
│ │ │ ├── extend.js
│ │ │ ├── extend.pug
│ │ │ ├── form.js
│ │ │ ├── form.pug
│ │ │ ├── includes/
│ │ │ │ ├── foot.pug
│ │ │ │ ├── head.pug
│ │ │ │ ├── scripts.pug
│ │ │ │ └── style.css
│ │ │ ├── includes.js
│ │ │ ├── includes.pug
│ │ │ ├── layout-debug.js
│ │ │ ├── layout.js
│ │ │ ├── layout.pug
│ │ │ ├── mixins/
│ │ │ │ ├── dialog.pug
│ │ │ │ └── profile.pug
│ │ │ ├── mixins.js
│ │ │ ├── mixins.pug
│ │ │ ├── pet.pug
│ │ │ ├── rss.js
│ │ │ ├── rss.pug
│ │ │ ├── text.js
│ │ │ ├── text.pug
│ │ │ ├── whitespace.js
│ │ │ └── whitespace.pug
│ │ ├── lib/
│ │ │ └── index.js
│ │ ├── package.json
│ │ ├── register.js
│ │ ├── support/
│ │ │ └── benchmark.js
│ │ └── test/
│ │ ├── README.md
│ │ ├── __snapshots__/
│ │ │ └── pug.test.js.snap
│ │ ├── anti-cases/
│ │ │ ├── attrs.unescaped.pug
│ │ │ ├── case-when.pug
│ │ │ ├── case-without-with.pug
│ │ │ ├── else-condition.pug
│ │ │ ├── else-without-if.pug
│ │ │ ├── inlining-a-mixin-after-a-tag.pug
│ │ │ ├── key-char-ending-badly.pug
│ │ │ ├── key-ending-badly.pug
│ │ │ ├── mismatched-inline-tag.pug
│ │ │ ├── mixin-args-syntax-error.pug
│ │ │ ├── mixins-blocks-with-bodies.pug
│ │ │ ├── multiple-non-nested-tags-on-a-line.pug
│ │ │ ├── non-existant-filter.pug
│ │ │ ├── non-mixin-block.pug
│ │ │ ├── open-brace-in-attributes.pug
│ │ │ ├── readme.md
│ │ │ ├── self-closing-tag-with-block.pug
│ │ │ ├── self-closing-tag-with-body.pug
│ │ │ ├── self-closing-tag-with-code.pug
│ │ │ ├── tabs-and-spaces.pug
│ │ │ ├── unclosed-interpolated-call.pug
│ │ │ ├── unclosed-interpolated-tag.pug
│ │ │ └── unclosed-interpolation.pug
│ │ ├── browser/
│ │ │ ├── index.html
│ │ │ └── index.pug
│ │ ├── cases/
│ │ │ ├── attrs-data.html
│ │ │ ├── attrs-data.pug
│ │ │ ├── attrs.colon.html
│ │ │ ├── attrs.colon.pug
│ │ │ ├── attrs.html
│ │ │ ├── attrs.js.html
│ │ │ ├── attrs.js.pug
│ │ │ ├── attrs.pug
│ │ │ ├── attrs.unescaped.html
│ │ │ ├── attrs.unescaped.pug
│ │ │ ├── auxiliary/
│ │ │ │ ├── 1794-extends.pug
│ │ │ │ ├── 1794-include.pug
│ │ │ │ ├── blocks-in-blocks-layout.pug
│ │ │ │ ├── dialog.pug
│ │ │ │ ├── empty-block.pug
│ │ │ │ ├── escapes.html
│ │ │ │ ├── extends-empty-block-1.pug
│ │ │ │ ├── extends-empty-block-2.pug
│ │ │ │ ├── extends-from-root.pug
│ │ │ │ ├── extends-relative.pug
│ │ │ │ ├── filter-in-include.pug
│ │ │ │ ├── includable.js
│ │ │ │ ├── include-from-root.pug
│ │ │ │ ├── inheritance.extend.mixin.block.pug
│ │ │ │ ├── inheritance.extend.recursive-grand-grandparent.pug
│ │ │ │ ├── inheritance.extend.recursive-grandparent.pug
│ │ │ │ ├── inheritance.extend.recursive-parent.pug
│ │ │ │ ├── layout.include.pug
│ │ │ │ ├── layout.pug
│ │ │ │ ├── mixin-at-end-of-file.pug
│ │ │ │ ├── mixins.pug
│ │ │ │ ├── pet.pug
│ │ │ │ ├── smile.html
│ │ │ │ ├── window.pug
│ │ │ │ └── yield-nested.pug
│ │ │ ├── basic.html
│ │ │ ├── basic.pug
│ │ │ ├── blanks.html
│ │ │ ├── blanks.pug
│ │ │ ├── block-code.html
│ │ │ ├── block-code.pug
│ │ │ ├── block-expansion.html
│ │ │ ├── block-expansion.pug
│ │ │ ├── block-expansion.shorthands.html
│ │ │ ├── block-expansion.shorthands.pug
│ │ │ ├── blockquote.html
│ │ │ ├── blockquote.pug
│ │ │ ├── blocks-in-blocks.html
│ │ │ ├── blocks-in-blocks.pug
│ │ │ ├── blocks-in-if.html
│ │ │ ├── blocks-in-if.pug
│ │ │ ├── case-blocks.html
│ │ │ ├── case-blocks.pug
│ │ │ ├── case.html
│ │ │ ├── case.pug
│ │ │ ├── classes-empty.html
│ │ │ ├── classes-empty.pug
│ │ │ ├── classes.html
│ │ │ ├── classes.pug
│ │ │ ├── code.conditionals.html
│ │ │ ├── code.conditionals.pug
│ │ │ ├── code.escape.html
│ │ │ ├── code.escape.pug
│ │ │ ├── code.html
│ │ │ ├── code.iteration.html
│ │ │ ├── code.iteration.pug
│ │ │ ├── code.pug
│ │ │ ├── comments-in-case.html
│ │ │ ├── comments-in-case.pug
│ │ │ ├── comments.html
│ │ │ ├── comments.pug
│ │ │ ├── comments.source.html
│ │ │ ├── comments.source.pug
│ │ │ ├── doctype.custom.html
│ │ │ ├── doctype.custom.pug
│ │ │ ├── doctype.default.html
│ │ │ ├── doctype.default.pug
│ │ │ ├── doctype.keyword.html
│ │ │ ├── doctype.keyword.pug
│ │ │ ├── each.else.html
│ │ │ ├── each.else.pug
│ │ │ ├── escape-chars.html
│ │ │ ├── escape-chars.pug
│ │ │ ├── escape-test.html
│ │ │ ├── escape-test.pug
│ │ │ ├── escaping-class-attribute.html
│ │ │ ├── escaping-class-attribute.pug
│ │ │ ├── filter-in-include.html
│ │ │ ├── filter-in-include.pug
│ │ │ ├── filters-empty.html
│ │ │ ├── filters-empty.pug
│ │ │ ├── filters.coffeescript.html
│ │ │ ├── filters.coffeescript.pug
│ │ │ ├── filters.custom.html
│ │ │ ├── filters.custom.pug
│ │ │ ├── filters.include.custom.html
│ │ │ ├── filters.include.custom.pug
│ │ │ ├── filters.include.html
│ │ │ ├── filters.include.pug
│ │ │ ├── filters.inline.html
│ │ │ ├── filters.inline.pug
│ │ │ ├── filters.less.html
│ │ │ ├── filters.less.pug
│ │ │ ├── filters.markdown.html
│ │ │ ├── filters.markdown.pug
│ │ │ ├── filters.nested.html
│ │ │ ├── filters.nested.pug
│ │ │ ├── filters.stylus.html
│ │ │ ├── filters.stylus.pug
│ │ │ ├── html.html
│ │ │ ├── html.pug
│ │ │ ├── html5.html
│ │ │ ├── html5.pug
│ │ │ ├── include-extends-from-root.html
│ │ │ ├── include-extends-from-root.pug
│ │ │ ├── include-extends-of-common-template.html
│ │ │ ├── include-extends-of-common-template.pug
│ │ │ ├── include-extends-relative.html
│ │ │ ├── include-extends-relative.pug
│ │ │ ├── include-filter-coffee.coffee
│ │ │ ├── include-only-text-body.html
│ │ │ ├── include-only-text-body.pug
│ │ │ ├── include-only-text.html
│ │ │ ├── include-only-text.pug
│ │ │ ├── include-with-text-head.html
│ │ │ ├── include-with-text-head.pug
│ │ │ ├── include-with-text.html
│ │ │ ├── include-with-text.pug
│ │ │ ├── include.script.html
│ │ │ ├── include.script.pug
│ │ │ ├── include.yield.nested.html
│ │ │ ├── include.yield.nested.pug
│ │ │ ├── includes-with-ext-js.html
│ │ │ ├── includes-with-ext-js.pug
│ │ │ ├── includes.html
│ │ │ ├── includes.pug
│ │ │ ├── inheritance.alert-dialog.html
│ │ │ ├── inheritance.alert-dialog.pug
│ │ │ ├── inheritance.defaults.html
│ │ │ ├── inheritance.defaults.pug
│ │ │ ├── inheritance.extend.html
│ │ │ ├── inheritance.extend.include.html
│ │ │ ├── inheritance.extend.include.pug
│ │ │ ├── inheritance.extend.mixins.block.html
│ │ │ ├── inheritance.extend.mixins.block.pug
│ │ │ ├── inheritance.extend.mixins.html
│ │ │ ├── inheritance.extend.mixins.pug
│ │ │ ├── inheritance.extend.pug
│ │ │ ├── inheritance.extend.recursive.html
│ │ │ ├── inheritance.extend.recursive.pug
│ │ │ ├── inheritance.extend.whitespace.html
│ │ │ ├── inheritance.extend.whitespace.pug
│ │ │ ├── inheritance.html
│ │ │ ├── inheritance.pug
│ │ │ ├── inline-tag.html
│ │ │ ├── inline-tag.pug
│ │ │ ├── intepolated-elements.html
│ │ │ ├── intepolated-elements.pug
│ │ │ ├── interpolated-mixin.html
│ │ │ ├── interpolated-mixin.pug
│ │ │ ├── interpolation.escape.html
│ │ │ ├── interpolation.escape.pug
│ │ │ ├── javascript-new-lines.js
│ │ │ ├── layout.append.html
│ │ │ ├── layout.append.pug
│ │ │ ├── layout.append.without-block.html
│ │ │ ├── layout.append.without-block.pug
│ │ │ ├── layout.multi.append.prepend.block.html
│ │ │ ├── layout.multi.append.prepend.block.pug
│ │ │ ├── layout.prepend.html
│ │ │ ├── layout.prepend.pug
│ │ │ ├── layout.prepend.without-block.html
│ │ │ ├── layout.prepend.without-block.pug
│ │ │ ├── mixin-at-end-of-file.html
│ │ │ ├── mixin-at-end-of-file.pug
│ │ │ ├── mixin-block-with-space.html
│ │ │ ├── mixin-block-with-space.pug
│ │ │ ├── mixin-hoist.html
│ │ │ ├── mixin-hoist.pug
│ │ │ ├── mixin-via-include.html
│ │ │ ├── mixin-via-include.pug
│ │ │ ├── mixin.attrs.html
│ │ │ ├── mixin.attrs.pug
│ │ │ ├── mixin.block-tag-behaviour.html
│ │ │ ├── mixin.block-tag-behaviour.pug
│ │ │ ├── mixin.blocks.html
│ │ │ ├── mixin.blocks.pug
│ │ │ ├── mixin.merge.html
│ │ │ ├── mixin.merge.pug
│ │ │ ├── mixins-unused.html
│ │ │ ├── mixins-unused.pug
│ │ │ ├── mixins.html
│ │ │ ├── mixins.pug
│ │ │ ├── mixins.rest-args.html
│ │ │ ├── mixins.rest-args.pug
│ │ │ ├── namespaces.html
│ │ │ ├── namespaces.pug
│ │ │ ├── nesting.html
│ │ │ ├── nesting.pug
│ │ │ ├── pipeless-comments.html
│ │ │ ├── pipeless-comments.pug
│ │ │ ├── pipeless-filters.html
│ │ │ ├── pipeless-filters.pug
│ │ │ ├── pipeless-tag.html
│ │ │ ├── pipeless-tag.pug
│ │ │ ├── pre.html
│ │ │ ├── pre.pug
│ │ │ ├── quotes.html
│ │ │ ├── quotes.pug
│ │ │ ├── regression.1794.html
│ │ │ ├── regression.1794.pug
│ │ │ ├── regression.784.html
│ │ │ ├── regression.784.pug
│ │ │ ├── script.whitespace.html
│ │ │ ├── script.whitespace.pug
│ │ │ ├── scripts.html
│ │ │ ├── scripts.non-js.html
│ │ │ ├── scripts.non-js.pug
│ │ │ ├── scripts.pug
│ │ │ ├── self-closing-html.html
│ │ │ ├── self-closing-html.pug
│ │ │ ├── single-period.html
│ │ │ ├── single-period.pug
│ │ │ ├── some-included.styl
│ │ │ ├── some.md
│ │ │ ├── some.styl
│ │ │ ├── source.html
│ │ │ ├── source.pug
│ │ │ ├── styles.html
│ │ │ ├── styles.pug
│ │ │ ├── tag.interpolation.html
│ │ │ ├── tag.interpolation.pug
│ │ │ ├── tags.self-closing.html
│ │ │ ├── tags.self-closing.pug
│ │ │ ├── template.html
│ │ │ ├── template.pug
│ │ │ ├── text-block.html
│ │ │ ├── text-block.pug
│ │ │ ├── text.html
│ │ │ ├── text.pug
│ │ │ ├── utf8bom.html
│ │ │ ├── utf8bom.pug
│ │ │ ├── vars.html
│ │ │ ├── vars.pug
│ │ │ ├── while.html
│ │ │ ├── while.pug
│ │ │ ├── xml.html
│ │ │ ├── xml.pug
│ │ │ ├── yield-before-conditional-head.html
│ │ │ ├── yield-before-conditional-head.pug
│ │ │ ├── yield-before-conditional.html
│ │ │ ├── yield-before-conditional.pug
│ │ │ ├── yield-head.html
│ │ │ ├── yield-head.pug
│ │ │ ├── yield-title-head.html
│ │ │ ├── yield-title-head.pug
│ │ │ ├── yield-title.html
│ │ │ ├── yield-title.pug
│ │ │ ├── yield.html
│ │ │ └── yield.pug
│ │ ├── cases-es2015/
│ │ │ ├── attr.html
│ │ │ └── attr.pug
│ │ ├── dependencies/
│ │ │ ├── dependency1.pug
│ │ │ ├── dependency2.pug
│ │ │ ├── dependency3.pug
│ │ │ ├── extends1.pug
│ │ │ ├── extends2.pug
│ │ │ ├── include1.pug
│ │ │ └── include2.pug
│ │ ├── duplicate-block/
│ │ │ ├── __snapshots__/
│ │ │ │ └── index.test.js.snap
│ │ │ ├── index.pug
│ │ │ ├── index.test.js
│ │ │ └── layout-with-duplicate-block.pug
│ │ ├── eachOf/
│ │ │ ├── __snapshots__/
│ │ │ │ └── index.test.js.snap
│ │ │ ├── error/
│ │ │ │ ├── left-side.pug
│ │ │ │ ├── no-brackets.pug
│ │ │ │ ├── one-val.pug
│ │ │ │ └── right-side.pug
│ │ │ ├── index.test.js
│ │ │ └── passing/
│ │ │ ├── brackets.pug
│ │ │ └── no-brackets.pug
│ │ ├── error.reporting.test.js
│ │ ├── examples.test.js
│ │ ├── extends-not-top-level/
│ │ │ ├── default.pug
│ │ │ ├── duplicate.pug
│ │ │ ├── index.pug
│ │ │ └── index.test.js
│ │ ├── fixtures/
│ │ │ ├── append/
│ │ │ │ ├── app-layout.pug
│ │ │ │ ├── layout.pug
│ │ │ │ ├── page.html
│ │ │ │ └── page.pug
│ │ │ ├── append-without-block/
│ │ │ │ ├── app-layout.pug
│ │ │ │ ├── layout.pug
│ │ │ │ └── page.pug
│ │ │ ├── compile.with.include.locals.error.pug
│ │ │ ├── compile.with.include.syntax.error.pug
│ │ │ ├── compile.with.layout.locals.error.pug
│ │ │ ├── compile.with.layout.syntax.error.pug
│ │ │ ├── compile.with.layout.with.include.locals.error.pug
│ │ │ ├── compile.with.layout.with.include.syntax.error.pug
│ │ │ ├── element-with-multiple-attributes.pug
│ │ │ ├── include.locals.error.pug
│ │ │ ├── include.syntax.error.pug
│ │ │ ├── invalid-block-in-extends.pug
│ │ │ ├── issue-1593/
│ │ │ │ ├── include-layout.pug
│ │ │ │ ├── include.pug
│ │ │ │ ├── index.pug
│ │ │ │ └── layout.pug
│ │ │ ├── layout.locals.error.pug
│ │ │ ├── layout.pug
│ │ │ ├── layout.syntax.error.pug
│ │ │ ├── layout.with.runtime.error.pug
│ │ │ ├── mixin-include.pug
│ │ │ ├── mixin.error.pug
│ │ │ ├── multi-append-prepend-block/
│ │ │ │ ├── redefine.pug
│ │ │ │ └── root.pug
│ │ │ ├── perf.pug
│ │ │ ├── prepend/
│ │ │ │ ├── app-layout.pug
│ │ │ │ ├── layout.pug
│ │ │ │ ├── page.html
│ │ │ │ └── page.pug
│ │ │ ├── prepend-without-block/
│ │ │ │ ├── app-layout.pug
│ │ │ │ ├── layout.pug
│ │ │ │ ├── page.html
│ │ │ │ └── page.pug
│ │ │ ├── runtime.error.pug
│ │ │ ├── runtime.layout.error.pug
│ │ │ ├── runtime.with.mixin.error.pug
│ │ │ └── scripts.pug
│ │ ├── markdown-it/
│ │ │ ├── comment.md
│ │ │ ├── index.test.js
│ │ │ ├── layout-markdown-include.pug
│ │ │ └── layout-markdown-inline.pug
│ │ ├── plugins.test.js
│ │ ├── pug.test.js
│ │ ├── regression-2436/
│ │ │ ├── __snapshots__/
│ │ │ │ └── index.test.js.snap
│ │ │ ├── index.test.js
│ │ │ ├── issue1.pug
│ │ │ ├── issue2.pug
│ │ │ ├── layout.pug
│ │ │ ├── other1.pug
│ │ │ ├── other2.pug
│ │ │ └── other_layout.pug
│ │ ├── run-es2015.test.js
│ │ ├── run-syntax-errors.test.js
│ │ ├── run-utils.js
│ │ ├── run.test.js
│ │ └── shadowed-block/
│ │ ├── __snapshots__/
│ │ │ └── index.test.js.snap
│ │ ├── base.pug
│ │ ├── index.pug
│ │ ├── index.test.js
│ │ └── layout.pug
│ ├── pug-attrs/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── index.js
│ │ ├── package.json
│ │ └── test/
│ │ └── index.test.js
│ ├── pug-code-gen/
│ │ ├── HISTORY.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── index.js
│ │ └── package.json
│ ├── pug-error/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── src/
│ │ │ └── index.ts
│ │ ├── test/
│ │ │ └── index.test.js
│ │ └── tsconfig.json
│ ├── pug-filters/
│ │ ├── CHANGELOG.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── index.js
│ │ ├── lib/
│ │ │ ├── handle-filters.js
│ │ │ └── run-filter.js
│ │ ├── package.json
│ │ └── test/
│ │ ├── __snapshots__/
│ │ │ ├── filter-aliases.test.js.snap
│ │ │ ├── index.test.js.snap
│ │ │ └── per-filter-options-applied-to-nested-filters.test.js.snap
│ │ ├── cases/
│ │ │ ├── filters-empty.input.json
│ │ │ ├── filters.cdata.input.json
│ │ │ ├── filters.coffeescript.input.json
│ │ │ ├── filters.custom.input.json
│ │ │ ├── filters.include.custom.input.json
│ │ │ ├── filters.include.custom.pug
│ │ │ ├── filters.include.input.json
│ │ │ ├── filters.inline.input.json
│ │ │ ├── filters.less.input.json
│ │ │ ├── filters.markdown.input.json
│ │ │ ├── filters.nested.input.json
│ │ │ ├── filters.stylus.input.json
│ │ │ ├── include-filter-coffee.coffee
│ │ │ └── some.md
│ │ ├── custom-filters.js
│ │ ├── errors/
│ │ │ └── dynamic-option.input.json
│ │ ├── errors-src/
│ │ │ └── dynamic-option.jade
│ │ ├── filter-aliases.test.js
│ │ ├── index.test.js
│ │ └── per-filter-options-applied-to-nested-filters.test.js
│ ├── pug-lexer/
│ │ ├── History.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── index.d.ts
│ │ ├── index.js
│ │ ├── package.json
│ │ └── test/
│ │ ├── __snapshots__/
│ │ │ └── index.test.js.snap
│ │ ├── cases/
│ │ │ ├── attr-es2015.pug
│ │ │ ├── attrs-data.pug
│ │ │ ├── attrs.js.pug
│ │ │ ├── attrs.pug
│ │ │ ├── attrs.unescaped.pug
│ │ │ ├── basic.pug
│ │ │ ├── blanks.pug
│ │ │ ├── block-code.pug
│ │ │ ├── block-expansion.pug
│ │ │ ├── block-expansion.shorthands.pug
│ │ │ ├── blockquote.pug
│ │ │ ├── blocks-in-blocks.pug
│ │ │ ├── blocks-in-if.pug
│ │ │ ├── case-blocks.pug
│ │ │ ├── case.pug
│ │ │ ├── classes-empty.pug
│ │ │ ├── classes.pug
│ │ │ ├── code.conditionals.pug
│ │ │ ├── code.escape.pug
│ │ │ ├── code.iteration.pug
│ │ │ ├── code.pug
│ │ │ ├── comments-in-case.pug
│ │ │ ├── comments.pug
│ │ │ ├── comments.source.pug
│ │ │ ├── doctype.custom.pug
│ │ │ ├── doctype.default.pug
│ │ │ ├── doctype.keyword.pug
│ │ │ ├── each.else.pug
│ │ │ ├── escape-chars.pug
│ │ │ ├── escape-test.pug
│ │ │ ├── escaping-class-attribute.pug
│ │ │ ├── filter-in-include.pug
│ │ │ ├── filters-empty.pug
│ │ │ ├── filters.coffeescript.pug
│ │ │ ├── filters.custom.pug
│ │ │ ├── filters.include.custom.pug
│ │ │ ├── filters.include.pug
│ │ │ ├── filters.inline.pug
│ │ │ ├── filters.less.pug
│ │ │ ├── filters.markdown.pug
│ │ │ ├── filters.nested.pug
│ │ │ ├── filters.stylus.pug
│ │ │ ├── filters.verbatim.pug
│ │ │ ├── html.pug
│ │ │ ├── html5.pug
│ │ │ ├── include-extends-from-root.pug
│ │ │ ├── include-extends-of-common-template.pug
│ │ │ ├── include-extends-relative.pug
│ │ │ ├── include-only-text-body.pug
│ │ │ ├── include-only-text.pug
│ │ │ ├── include-with-text-head.pug
│ │ │ ├── include-with-text.pug
│ │ │ ├── include.script.pug
│ │ │ ├── include.yield.nested.pug
│ │ │ ├── includes-with-ext-js.pug
│ │ │ ├── includes.pug
│ │ │ ├── inheritance.alert-dialog.pug
│ │ │ ├── inheritance.defaults.pug
│ │ │ ├── inheritance.extend.include.pug
│ │ │ ├── inheritance.extend.mixins.block.pug
│ │ │ ├── inheritance.extend.mixins.pug
│ │ │ ├── inheritance.extend.pug
│ │ │ ├── inheritance.extend.recursive.pug
│ │ │ ├── inheritance.extend.whitespace.pug
│ │ │ ├── inheritance.pug
│ │ │ ├── inline-block-comment.pug
│ │ │ ├── inline-tag.pug
│ │ │ ├── intepolated-elements.pug
│ │ │ ├── interpolated-mixin.pug
│ │ │ ├── interpolation.escape.pug
│ │ │ ├── javascript-new-lines.js
│ │ │ ├── layout.append.pug
│ │ │ ├── layout.append.without-block.pug
│ │ │ ├── layout.multi.append.prepend.block.pug
│ │ │ ├── layout.prepend.pug
│ │ │ ├── layout.prepend.without-block.pug
│ │ │ ├── mixin-at-end-of-file.pug
│ │ │ ├── mixin-block-with-space.pug
│ │ │ ├── mixin-hoist.pug
│ │ │ ├── mixin-via-include.pug
│ │ │ ├── mixin.attrs.pug
│ │ │ ├── mixin.block-tag-behaviour.pug
│ │ │ ├── mixin.blocks.pug
│ │ │ ├── mixin.merge.pug
│ │ │ ├── mixins-unused.pug
│ │ │ ├── mixins.pug
│ │ │ ├── mixins.rest-args.pug
│ │ │ ├── namespaces.pug
│ │ │ ├── nesting.pug
│ │ │ ├── pipeless-comments.pug
│ │ │ ├── pipeless-filters.pug
│ │ │ ├── pipeless-tag.pug
│ │ │ ├── pre.pug
│ │ │ ├── quotes.pug
│ │ │ ├── regression.1794.pug
│ │ │ ├── regression.784.pug
│ │ │ ├── script.whitespace.pug
│ │ │ ├── scripts.non-js.pug
│ │ │ ├── scripts.pug
│ │ │ ├── self-closing-html.pug
│ │ │ ├── single-period.pug
│ │ │ ├── source.pug
│ │ │ ├── styles.pug
│ │ │ ├── tag-blocks.pug
│ │ │ ├── tag.interpolation.pug
│ │ │ ├── tags.self-closing.pug
│ │ │ ├── template.pug
│ │ │ ├── text-block.pug
│ │ │ ├── text.pug
│ │ │ ├── utf8bom.pug
│ │ │ ├── vars.pug
│ │ │ ├── while.pug
│ │ │ ├── xml.pug
│ │ │ ├── yield-before-conditional-head.pug
│ │ │ ├── yield-before-conditional.pug
│ │ │ ├── yield-head.pug
│ │ │ ├── yield-title-head.pug
│ │ │ ├── yield-title.pug
│ │ │ └── yield.pug
│ │ ├── check-lexer-functions.test.js
│ │ ├── errors/
│ │ │ ├── attribute-invalid-expression.pug
│ │ │ ├── case-with-invalid-expression.pug
│ │ │ ├── case-with-no-expression.pug
│ │ │ ├── default-with-expression.pug
│ │ │ ├── else-with-condition.pug
│ │ │ ├── extends-no-path.pug
│ │ │ ├── include-filter-no-path-2.pug
│ │ │ ├── include-filter-no-path.pug
│ │ │ ├── include-filter-no-space.pug
│ │ │ ├── include-no-path.pug
│ │ │ ├── inconsistent-indentation.pug
│ │ │ ├── interpolated-call.pug
│ │ │ ├── invalid-class-name-1.pug
│ │ │ ├── invalid-class-name-2.pug
│ │ │ ├── invalid-class-name-3.pug
│ │ │ ├── invalid-id.pug
│ │ │ ├── malformed-each.pug
│ │ │ ├── malformed-extend.pug
│ │ │ ├── malformed-include.pug
│ │ │ ├── mismatched-inline-tag.pug
│ │ │ ├── mismatched-tag-interpolation.pug
│ │ │ ├── multi-line-interpolation.pug
│ │ │ ├── old-prefixed-each.pug
│ │ │ ├── open-interpolation.pug
│ │ │ ├── when-with-no-expression.pug
│ │ │ └── while-with-no-expression.pug
│ │ └── index.test.js
│ ├── pug-linker/
│ │ ├── HISTORY.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── index.js
│ │ ├── package.json
│ │ └── test/
│ │ ├── __snapshots__/
│ │ │ └── index.test.js.snap
│ │ ├── cases/
│ │ │ ├── include-extends-from-root.input.json
│ │ │ ├── include-extends-of-common-template.input.json
│ │ │ ├── include-extends-relative.input.json
│ │ │ ├── include-filter-stylus.input.json
│ │ │ ├── include-filter.input.json
│ │ │ ├── include-only-text-body.input.json
│ │ │ ├── include-only-text.input.json
│ │ │ ├── include-with-text-head.input.json
│ │ │ ├── include-with-text.input.json
│ │ │ ├── include.script.input.json
│ │ │ ├── include.yield.nested.input.json
│ │ │ ├── includes-with-ext-js.input.json
│ │ │ ├── includes.input.json
│ │ │ ├── layout.append.input.json
│ │ │ ├── layout.append.without-block.input.json
│ │ │ ├── layout.multi.append.prepend.block.input.json
│ │ │ ├── layout.prepend.input.json
│ │ │ └── layout.prepend.without-block.input.json
│ │ ├── cases-src/
│ │ │ ├── auxiliary/
│ │ │ │ ├── 1794-extends.pug
│ │ │ │ ├── 1794-include.pug
│ │ │ │ ├── blocks-in-blocks-layout.pug
│ │ │ │ ├── dialog.pug
│ │ │ │ ├── empty-block.pug
│ │ │ │ ├── escapes.html
│ │ │ │ ├── extends-empty-block-1.pug
│ │ │ │ ├── extends-empty-block-2.pug
│ │ │ │ ├── extends-from-root.pug
│ │ │ │ ├── extends-relative.pug
│ │ │ │ ├── filter-in-include.pug
│ │ │ │ ├── includable.js
│ │ │ │ ├── include-from-root.pug
│ │ │ │ ├── inheritance.extend.mixin.block.pug
│ │ │ │ ├── inheritance.extend.recursive-grand-grandparent.pug
│ │ │ │ ├── inheritance.extend.recursive-grandparent.pug
│ │ │ │ ├── inheritance.extend.recursive-parent.pug
│ │ │ │ ├── layout.include.pug
│ │ │ │ ├── layout.pug
│ │ │ │ ├── mixin-at-end-of-file.pug
│ │ │ │ ├── mixins.pug
│ │ │ │ ├── pet.pug
│ │ │ │ ├── smile.html
│ │ │ │ ├── window.pug
│ │ │ │ └── yield-nested.pug
│ │ │ ├── include-extends-from-root.pug
│ │ │ ├── include-extends-of-common-template.pug
│ │ │ ├── include-extends-relative.pug
│ │ │ ├── include-filter-coffee.coffee
│ │ │ ├── include-filter-stylus.pug
│ │ │ ├── include-filter.pug
│ │ │ ├── include-only-text-body.pug
│ │ │ ├── include-only-text.pug
│ │ │ ├── include-with-text-head.pug
│ │ │ ├── include-with-text.pug
│ │ │ ├── include.script.pug
│ │ │ ├── include.yield.nested.pug
│ │ │ ├── includes-with-ext-js.pug
│ │ │ ├── includes.pug
│ │ │ ├── javascript-new-lines.js
│ │ │ ├── layout.append.pug
│ │ │ ├── layout.append.without-block.pug
│ │ │ ├── layout.multi.append.prepend.block.pug
│ │ │ ├── layout.prepend.pug
│ │ │ ├── layout.prepend.without-block.pug
│ │ │ ├── some-included.styl
│ │ │ ├── some.md
│ │ │ └── some.styl
│ │ ├── errors/
│ │ │ ├── child-with-tags.input.json
│ │ │ ├── extends-not-first.input.json
│ │ │ └── unexpected-block.input.json
│ │ ├── errors-src/
│ │ │ ├── child-with-tags.pug
│ │ │ ├── extends-not-first.pug
│ │ │ └── unexpected-block.pug
│ │ ├── fixtures/
│ │ │ ├── append/
│ │ │ │ ├── app-layout.pug
│ │ │ │ ├── layout.pug
│ │ │ │ ├── page.html
│ │ │ │ └── page.pug
│ │ │ ├── append-without-block/
│ │ │ │ ├── app-layout.pug
│ │ │ │ ├── layout.pug
│ │ │ │ └── page.pug
│ │ │ ├── empty.pug
│ │ │ ├── layout.pug
│ │ │ ├── mixins.pug
│ │ │ ├── multi-append-prepend-block/
│ │ │ │ ├── redefine.pug
│ │ │ │ └── root.pug
│ │ │ ├── prepend/
│ │ │ │ ├── app-layout.pug
│ │ │ │ ├── layout.pug
│ │ │ │ ├── page.html
│ │ │ │ └── page.pug
│ │ │ └── prepend-without-block/
│ │ │ ├── app-layout.pug
│ │ │ ├── layout.pug
│ │ │ ├── page.html
│ │ │ └── page.pug
│ │ ├── index.test.js
│ │ ├── special-cases/
│ │ │ ├── extending-empty.input.json
│ │ │ ├── extending-include.input.json
│ │ │ └── root-mixin.input.json
│ │ └── special-cases-src/
│ │ ├── extending-empty.pug
│ │ ├── extending-include.pug
│ │ └── root-mixin.pug
│ ├── pug-load/
│ │ ├── HISTORY.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── index.js
│ │ ├── package.json
│ │ └── test/
│ │ ├── __snapshots__/
│ │ │ └── index.test.js.snap
│ │ ├── bar.pug
│ │ ├── bing.pug
│ │ ├── foo.pug
│ │ ├── index.test.js
│ │ └── script.js
│ ├── pug-parser/
│ │ ├── HISTORY.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── index.js
│ │ ├── lib/
│ │ │ └── inline-tags.js
│ │ ├── package.json
│ │ └── test/
│ │ ├── __snapshots__/
│ │ │ ├── index.test.js.snap
│ │ │ └── no-unnecessary-blocks.test.js.snap
│ │ ├── cases/
│ │ │ ├── attr-es2015.tokens.json
│ │ │ ├── attrs-data.tokens.json
│ │ │ ├── attrs.js.tokens.json
│ │ │ ├── attrs.tokens.json
│ │ │ ├── attrs.unescaped.tokens.json
│ │ │ ├── basic.tokens.json
│ │ │ ├── blanks.tokens.json
│ │ │ ├── block-code.tokens.json
│ │ │ ├── block-expansion.shorthands.tokens.json
│ │ │ ├── block-expansion.tokens.json
│ │ │ ├── blockquote.tokens.json
│ │ │ ├── blocks-in-blocks.tokens.json
│ │ │ ├── blocks-in-if.tokens.json
│ │ │ ├── case-blocks.tokens.json
│ │ │ ├── case.tokens.json
│ │ │ ├── classes-empty.tokens.json
│ │ │ ├── classes.tokens.json
│ │ │ ├── code.conditionals.tokens.json
│ │ │ ├── code.escape.tokens.json
│ │ │ ├── code.iteration.tokens.json
│ │ │ ├── code.tokens.json
│ │ │ ├── comments-in-case.tokens.json
│ │ │ ├── comments.source.tokens.json
│ │ │ ├── comments.tokens.json
│ │ │ ├── doctype.custom.tokens.json
│ │ │ ├── doctype.default.tokens.json
│ │ │ ├── doctype.keyword.tokens.json
│ │ │ ├── each.else.tokens.json
│ │ │ ├── escape-chars.tokens.json
│ │ │ ├── escape-test.tokens.json
│ │ │ ├── escaping-class-attribute.tokens.json
│ │ │ ├── filter-in-include.tokens.json
│ │ │ ├── filters-empty.tokens.json
│ │ │ ├── filters.coffeescript.tokens.json
│ │ │ ├── filters.custom.tokens.json
│ │ │ ├── filters.include.custom.tokens.json
│ │ │ ├── filters.include.tokens.json
│ │ │ ├── filters.inline.tokens.json
│ │ │ ├── filters.less.tokens.json
│ │ │ ├── filters.markdown.tokens.json
│ │ │ ├── filters.nested.tokens.json
│ │ │ ├── filters.stylus.tokens.json
│ │ │ ├── filters.verbatim.tokens.json
│ │ │ ├── html.tokens.json
│ │ │ ├── html5.tokens.json
│ │ │ ├── include-extends-from-root.tokens.json
│ │ │ ├── include-extends-of-common-template.tokens.json
│ │ │ ├── include-extends-relative.tokens.json
│ │ │ ├── include-only-text-body.tokens.json
│ │ │ ├── include-only-text.tokens.json
│ │ │ ├── include-with-text-head.tokens.json
│ │ │ ├── include-with-text.tokens.json
│ │ │ ├── include.script.tokens.json
│ │ │ ├── include.yield.nested.tokens.json
│ │ │ ├── includes-with-ext-js.tokens.json
│ │ │ ├── includes.tokens.json
│ │ │ ├── inheritance.alert-dialog.tokens.json
│ │ │ ├── inheritance.defaults.tokens.json
│ │ │ ├── inheritance.extend.include.tokens.json
│ │ │ ├── inheritance.extend.mixins.block.tokens.json
│ │ │ ├── inheritance.extend.mixins.tokens.json
│ │ │ ├── inheritance.extend.recursive.tokens.json
│ │ │ ├── inheritance.extend.tokens.json
│ │ │ ├── inheritance.extend.whitespace.tokens.json
│ │ │ ├── inheritance.tokens.json
│ │ │ ├── inline-block-comment.tokens.json
│ │ │ ├── inline-tag.tokens.json
│ │ │ ├── intepolated-elements.tokens.json
│ │ │ ├── interpolated-mixin.tokens.json
│ │ │ ├── interpolation.escape.tokens.json
│ │ │ ├── layout.append.tokens.json
│ │ │ ├── layout.append.without-block.tokens.json
│ │ │ ├── layout.multi.append.prepend.block.tokens.json
│ │ │ ├── layout.prepend.tokens.json
│ │ │ ├── layout.prepend.without-block.tokens.json
│ │ │ ├── mixin-at-end-of-file.tokens.json
│ │ │ ├── mixin-block-with-space.tokens.json
│ │ │ ├── mixin-hoist.tokens.json
│ │ │ ├── mixin-via-include.tokens.json
│ │ │ ├── mixin.attrs.tokens.json
│ │ │ ├── mixin.block-tag-behaviour.tokens.json
│ │ │ ├── mixin.blocks.tokens.json
│ │ │ ├── mixin.merge.tokens.json
│ │ │ ├── mixins-unused.tokens.json
│ │ │ ├── mixins.rest-args.tokens.json
│ │ │ ├── mixins.tokens.json
│ │ │ ├── namespaces.tokens.json
│ │ │ ├── nesting.tokens.json
│ │ │ ├── pipeless-comments.tokens.json
│ │ │ ├── pipeless-filters.tokens.json
│ │ │ ├── pipeless-tag.tokens.json
│ │ │ ├── pre.tokens.json
│ │ │ ├── quotes.tokens.json
│ │ │ ├── regression.1794.tokens.json
│ │ │ ├── regression.784.tokens.json
│ │ │ ├── script.whitespace.tokens.json
│ │ │ ├── scripts.non-js.tokens.json
│ │ │ ├── scripts.tokens.json
│ │ │ ├── self-closing-html.tokens.json
│ │ │ ├── single-period.tokens.json
│ │ │ ├── source.tokens.json
│ │ │ ├── styles.tokens.json
│ │ │ ├── tag-blocks.tokens.json
│ │ │ ├── tag.interpolation.tokens.json
│ │ │ ├── tags.self-closing.tokens.json
│ │ │ ├── template.tokens.json
│ │ │ ├── text-block.tokens.json
│ │ │ ├── text.tokens.json
│ │ │ ├── utf8bom.tokens.json
│ │ │ ├── vars.tokens.json
│ │ │ ├── while.tokens.json
│ │ │ ├── xml.tokens.json
│ │ │ ├── yield-before-conditional-head.tokens.json
│ │ │ ├── yield-before-conditional.tokens.json
│ │ │ ├── yield-head.tokens.json
│ │ │ ├── yield-title-head.tokens.json
│ │ │ ├── yield-title.tokens.json
│ │ │ └── yield.tokens.json
│ │ ├── index.test.js
│ │ └── no-unnecessary-blocks.test.js
│ ├── pug-runtime/
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── build.js
│ │ ├── index.js
│ │ ├── package.json
│ │ ├── prepublish.js
│ │ ├── test/
│ │ │ └── index.test.js
│ │ └── wrap.js
│ ├── pug-strip-comments/
│ │ ├── CHANGELOG.md
│ │ ├── LICENSE
│ │ ├── LICENSE.md
│ │ ├── README.md
│ │ ├── index.js
│ │ ├── package.json
│ │ └── test/
│ │ ├── __snapshots__/
│ │ │ └── index.test.js.snap
│ │ ├── cases/
│ │ │ ├── comments-in-case.input.json
│ │ │ ├── comments.input.json
│ │ │ └── comments.source.input.json
│ │ ├── errors/
│ │ │ ├── comment-in-comment.input.json
│ │ │ ├── end.input.json
│ │ │ └── startstart.input.json
│ │ └── index.test.js
│ └── pug-walk/
│ ├── .gitignore
│ ├── .travis.yml
│ ├── HISTORY.md
│ ├── LICENSE
│ ├── README.md
│ ├── index.js
│ ├── package.json
│ └── test/
│ └── index.test.js
├── scripts/
│ ├── buffer-serializer.js
│ ├── filename-serializer.js
│ ├── prebuild.js
│ └── prettier-javascript-serializer.js
└── tsconfig.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
================================================
FILE: .gitattributes
================================================
* text=auto eol=lf
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: pug
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/pug
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with a single custom sponsorship URL
================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
<!-- For bugs and feature request, please fillin the following -->
<!-- For general questions, please use the pug tag on stack overflow: -->
<!-- https://stackoverflow.com/questions/tagged/pug -->
**Pug Version:** your version number here
**Node Version:** your version number here
## Input JavaScript Values
```js
pug.renderFile('input.pug', {
whatIsIt: 'language',
});
```
## Input Pug
```pug
h1 I Love Pug
p It's a great #{whatIsIt}
```
## Expected HTML
```html
<h1>I Love Pug</h1>
<p>It's a great language</p>
```
## Actual HTML
```html
<h1>I Love Pug</h1>
<p>It's a great language</p>
```
## Additional Comments
<!-- Please give us any additional details we'll need in order to understand the issue here -->
================================================
FILE: .github/workflows/rollingversions.yml
================================================
name: Release
on:
push:
branches:
- master
repository_dispatch:
types: [rollingversions_publish_approved]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile
- run: yarn prettier:check
- run: yarn test
publish-canary:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs: test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 24.x
registry-url: 'https://registry.npmjs.org'
- run: yarn install --frozen-lockfile
- run: yarn build
- run: npx rollingversions publish --canary $GITHUB_RUN_NUMBER
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'repository_dispatch' }}
needs: test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 24.x
registry-url: 'https://registry.npmjs.org'
- run: yarn install --frozen-lockfile
- run: yarn build
- run: npx rollingversions publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
id-token: write
contents: write
================================================
FILE: .github/workflows/test.yml
================================================
name: Test
on:
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile
- run: yarn prettier:check
- run: yarn test
================================================
FILE: .gitignore
================================================
.DS_Store
.idea
.vscode
testing
node_modules
lib-cov
coverage
cov-pt*
*.seed
*.log
*.csv
*.dat
*.out
*.patch
*.pid
*.gz
**/test/output*
**/test/temp
.release.json
package-lock.json
scripts/tsconfig.json
packages/pug-error/lib
================================================
FILE: .prettierrc.js
================================================
module.exports = {
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
overrides: [
{
files: '*.js',
options: {
parser: 'babel',
trailingComma: 'es5',
},
},
],
};
================================================
FILE: README.md
================================================
<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/).
[Professionally supported pug is now available](https://tidelift.com/subscription/pkg/npm-pug?utm_source=npm-pug&utm_medium=referral&utm_campaign=readme)
[](https://github.com/pugjs/pug/actions?query=workflow%3ATest+branch%3Amaster)
[](https://rollingversions.com/pugjs/pug)
[](https://www.npmjs.com/package/pug)
[](https://gitter.im/pugjs/pug?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Packages
<!-- VERSION_TABLE -->
Package Name | Version
-------------|--------
pug | [](https://www.npmjs.com/package/pug)
pug-attrs | [](https://www.npmjs.com/package/pug-attrs)
pug-code-gen | [](https://www.npmjs.com/package/pug-code-gen)
pug-error | [](https://www.npmjs.com/package/pug-error)
pug-filters | [](https://www.npmjs.com/package/pug-filters)
pug-lexer | [](https://www.npmjs.com/package/pug-lexer)
pug-linker | [](https://www.npmjs.com/package/pug-linker)
pug-load | [](https://www.npmjs.com/package/pug-load)
pug-parser | [](https://www.npmjs.com/package/pug-parser)
pug-runtime | [](https://www.npmjs.com/package/pug-runtime)
pug-strip-comments | [](https://www.npmjs.com/package/pug-strip-comments)
pug-walk | [](https://www.npmjs.com/package/pug-walk)
<!-- VERSION_TABLE -->
## Rename from "Jade"
This project was formerly known as "Jade". However, it was revealed to us that "Jade" is a registered trademark; as a result, a rename was needed. After some discussion among the maintainers, **"Pug"** was chosen as the new name for this project. As of version 2, "pug" is the official 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, work had already begun on “Jade 2.0.0”. Therefore, the rename to Pug coincided with the major version bump. As a result, upgrading from Jade to Pug will be the same process as upgrading any other package with a major version bump.
The syntax of Pug has several differences, deprecations, and removals compared to its predecessor. These differences are documented in [#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 from npm.
## Installation
### Package
To use Pug in your own JavaScript projects:
```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.
```
Pug transforms the above to:
```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 [downloaded for the browser in standalone form](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.
## 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
### Ports in other languages
Ports to other languages, with very close syntax:
- [PHP](https://github.com/pug-php/pug)
- [Java](https://github.com/neuland/jade4j)
- [Python](https://github.com/kakulukia/pypugjs)
- [Ruby](https://github.com/yivo/pug-ruby)
- [C# (ASP.NET Core)](https://github.com/AspNetMonsters/pugzor)
- [RPG/ILE](https://github.com/WorksOfLiam/apug)
### Equivalents in other languages
Templates engines for other languages with a different syntax, but a similar philosophy:
- [Scaml for Scala](https://scalate.github.io/scalate/documentation/scaml-reference.html)
- [Slim for Ruby](https://github.com/slim-template/slim) (should not be confused with Slim PHP framework)
- [HAML for Ruby](http://haml.info)
### Framework implementations/adapters
Embedded view engines for frameworks:
- [Laravel](https://github.com/BKWLD/laravel-pug)
- [Symfony](https://github.com/pug-php/pug-symfony)
- [Phalcon](https://github.com/pug-php/pug-phalcon)
- [CodeIgniter](https://github.com/pug-php/ci-pug-engine)
- [Yii 2](https://github.com/pug-php/pug-yii2)
- [Slim 3](https://github.com/pug-php/pug-slim)
- [Silex (implementation example)](https://gist.github.com/kylekatarnls/ba13e4361ab14f4ff5d2a5775eb0cc10)
- [Lumen](https://github.com/BKWLD/laravel-pug#use-in-lumen)
- [Rails](https://github.com/yivo/pug-rails)
### CMS plugins
- [WordPress](https://github.com/welaika/wordless)
## Additional Resources
- [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/ctrlaltdev/pug-server) Ideal for building local prototypes apart from any application
- [cache-pug-templates](https://github.com/ladjs/cache-pug-templates) Cache Pug templates for [Lad](https://github.com/ladjs/lad)/[Koa](https://github.com/koajs/koa)/[Express](https://github.com/expressjs/express)/[Connect](https://github.com/senchalabs/connect) with [Redis](https://redis.io)
- [Prettier Plugin](https://github.com/prettier/plugin-pug)
## Backers
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/pug#backer)]
<a href="https://opencollective.com/pug/backer/0/website" target="_blank"><img src="https://opencollective.com/pug/backer/0/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/1/website" target="_blank"><img src="https://opencollective.com/pug/backer/1/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/2/website" target="_blank"><img src="https://opencollective.com/pug/backer/2/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/3/website" target="_blank"><img src="https://opencollective.com/pug/backer/3/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/4/website" target="_blank"><img src="https://opencollective.com/pug/backer/4/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/5/website" target="_blank"><img src="https://opencollective.com/pug/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/6/website" target="_blank"><img src="https://opencollective.com/pug/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/7/website" target="_blank"><img src="https://opencollective.com/pug/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/8/website" target="_blank"><img src="https://opencollective.com/pug/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/9/website" target="_blank"><img src="https://opencollective.com/pug/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/10/website" target="_blank"><img src="https://opencollective.com/pug/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/11/website" target="_blank"><img src="https://opencollective.com/pug/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/12/website" target="_blank"><img src="https://opencollective.com/pug/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/13/website" target="_blank"><img src="https://opencollective.com/pug/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/14/website" target="_blank"><img src="https://opencollective.com/pug/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/15/website" target="_blank"><img src="https://opencollective.com/pug/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/16/website" target="_blank"><img src="https://opencollective.com/pug/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/17/website" target="_blank"><img src="https://opencollective.com/pug/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/18/website" target="_blank"><img src="https://opencollective.com/pug/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/19/website" target="_blank"><img src="https://opencollective.com/pug/backer/19/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/20/website" target="_blank"><img src="https://opencollective.com/pug/backer/20/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/21/website" target="_blank"><img src="https://opencollective.com/pug/backer/21/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/22/website" target="_blank"><img src="https://opencollective.com/pug/backer/22/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/23/website" target="_blank"><img src="https://opencollective.com/pug/backer/23/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/24/website" target="_blank"><img src="https://opencollective.com/pug/backer/24/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/25/website" target="_blank"><img src="https://opencollective.com/pug/backer/25/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/26/website" target="_blank"><img src="https://opencollective.com/pug/backer/26/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/27/website" target="_blank"><img src="https://opencollective.com/pug/backer/27/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/28/website" target="_blank"><img src="https://opencollective.com/pug/backer/28/avatar.svg"></a>
<a href="https://opencollective.com/pug/backer/29/website" target="_blank"><img src="https://opencollective.com/pug/backer/29/avatar.svg"></a>
## Sponsors
Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor](https://opencollective.com/pug#sponsor)]
<a href="https://opencollective.com/pug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/10/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/11/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/12/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/13/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/14/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/15/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/16/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/17/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/18/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/19/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/20/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/21/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/22/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/23/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/24/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/25/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/26/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/27/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/28/avatar.svg"></a>
<a href="https://opencollective.com/pug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/pug/sponsor/29/avatar.svg"></a>
## License
MIT
================================================
FILE: SECURITY.md
================================================
# Security Policy
## Supported Versions
| Version | Supported |
| -------- | ------------------ |
| ^3.0.1 | :white_check_mark: |
| <3.0.1 | :x: |
## Reporting a Vulnerability
To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure.
================================================
FILE: package.json
================================================
{
"name": "pug-monorepo",
"private": true,
"@rollingversions/ignore": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"coveralls": "3.0.9",
"jest": "^26.0.1",
"prettier": "1.19.1",
"typescript": "^4.1.2",
"wsrun": "^5.2.0"
},
"repository": {
"type": "git",
"url": "https://github.com/pugjs/pug.git"
},
"scripts": {
"prettier:check": "prettier --ignore-path .gitignore --list-different './**/*.js'",
"format": "prettier --ignore-path .gitignore --write './**/*.js'",
"build": "node scripts/prebuild && wsrun --stages --exclude-missing --fast-exit --collect-logs build && tsc --build scripts",
"pretest": "yarn build",
"test": "jest",
"coverage": "jest --coverage",
"coveralls": "jest --coverage --coverageReporters=text-lcov | coveralls",
"watch": "jest --watch"
},
"jest": {
"testEnvironment": "node",
"snapshotSerializers": [
"./scripts/filename-serializer.js",
"./scripts/prettier-javascript-serializer.js",
"./scripts/buffer-serializer.js"
]
},
"license": "MIT"
}
================================================
FILE: packages/pug/History.md
================================================
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]
================================================
FILE: packages/pug/LICENSE
================================================
(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.
================================================
FILE: packages/pug/README.md
================================================
<!-- 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/).
[](https://travis-ci.org/pugjs/pug)
[](https://coveralls.io/r/pugjs/pug?branch=master)
[](https://david-dm.org/pugjs/pug?path=packages/pug)
[](https://david-dm.org/pugjs/pug?path=packages/pug&type=dev)
[](https://www.npmjs.com/package/pug)
[](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
================================================
FILE: packages/pug/examples/README.md
================================================
The examples in this directory can be run simply by something like.
node attributes.js
You can also open `browser.html` in a browser.
================================================
FILE: packages/pug/examples/attributes.js
================================================
/**
* 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'}));
================================================
FILE: packages/pug/examples/attributes.pug
================================================
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')
================================================
FILE: packages/pug/examples/code.js
================================================
/**
* 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}));
================================================
FILE: packages/pug/examples/code.pug
================================================
- 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}
================================================
FILE: packages/pug/examples/dynamicscript.js
================================================
/**
* 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));
================================================
FILE: packages/pug/examples/dynamicscript.pug
================================================
html
head
title Dynamic Inline JavaScript
script.
var users = !{JSON.stringify(users).replace(/<\//g, "<\\/")}
================================================
FILE: packages/pug/examples/each.js
================================================
/**
* 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}));
================================================
FILE: packages/pug/examples/each.pug
================================================
ul#users
each user, name in users
li(class='user-' + name) #{name} #{user.email}
================================================
FILE: packages/pug/examples/extend-layout.pug
================================================
html
head
h1 My Site - #{title}
block scripts
script(src='/jquery.js')
body
block content
block foot
#footer
p some footer content
================================================
FILE: packages/pug/examples/extend.js
================================================
/**
* 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],
})
);
================================================
FILE: packages/pug/examples/extend.pug
================================================
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
================================================
FILE: packages/pug/examples/form.js
================================================
/**
* 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}));
================================================
FILE: packages/pug/examples/form.pug
================================================
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")
================================================
FILE: packages/pug/examples/includes/foot.pug
================================================
#footer
p Copyright (c) foobar
================================================
FILE: packages/pug/examples/includes/head.pug
================================================
head
title My Site
// including other pug works
include scripts.pug
// including .html, .css, etc works
include style.css
================================================
FILE: packages/pug/examples/includes/scripts.pug
================================================
script(src='/javascripts/jquery.js')
script(src='/javascripts/app.js')
================================================
FILE: packages/pug/examples/includes/style.css
================================================
<style>
body {
padding: 50px;
}
</style>
================================================
FILE: packages/pug/examples/includes.js
================================================
/**
* 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());
================================================
FILE: packages/pug/examples/includes.pug
================================================
html
include includes/head.pug
body
h1 My Site
p Welcome to my super lame site.
include includes/foot.pug
================================================
FILE: packages/pug/examples/layout-debug.js
================================================
/**
* Module dependencies.
*/
var pug = require('../');
pug.renderFile(__dirname + '/layout.pug', {debug: true}, function(err, html) {
if (err) throw err;
console.log(html);
});
================================================
FILE: packages/pug/examples/layout.js
================================================
/**
* 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());
================================================
FILE: packages/pug/examples/layout.pug
================================================
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).
================================================
FILE: packages/pug/examples/mixins/dialog.pug
================================================
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
================================================
FILE: packages/pug/examples/mixins/profile.pug
================================================
mixin pets(pets)
ul.pets
each pet in pets
li= pet
mixin profile(user)
.user
h2= user.name
+pets(user.pets)
================================================
FILE: packages/pug/examples/mixins.js
================================================
/**
* 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}));
================================================
FILE: packages/pug/examples/mixins.pug
================================================
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)
================================================
FILE: packages/pug/examples/pet.pug
================================================
.pet
h2= pet.name
p #{pet.name} is <em>#{pet.age}</em> year(s) old.
================================================
FILE: packages/pug/examples/rss.js
================================================
/**
* 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}));
================================================
FILE: packages/pug/examples/rss.pug
================================================
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
================================================
FILE: packages/pug/examples/text.js
================================================
/**
* 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'}));
================================================
FILE: packages/pug/examples/text.pug
================================================
| 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.
================================================
FILE: packages/pug/examples/whitespace.js
================================================
/**
* 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());
================================================
FILE: packages/pug/examples/whitespace.pug
================================================
- var js = '<script></script>'
doctype html
html
head
title= "Some " + "JavaScript"
!= js
body
================================================
FILE: packages/pug/lib/index.js
================================================
'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;
});
var contents = applyPlugins(
str,
{filename: options.filename},
plugins,
'preLex'
);
return applyPlugins(
lex(contents, 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);
}
debug_sources[filename] = Buffer.isBuffer(contents)
? contents.toString('utf8')
: contents;
return contents;
},
});
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 = (findReplacementFunc(plugins, 'generateCode') || 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);
};
================================================
FILE: packages/pug/package.json
================================================
{
"name": "pug",
"description": "A clean, whitespace-sensitive template language for writing HTML",
"keywords": [
"html",
"jade",
"pug",
"template"
],
"version": "2.0.4",
"author": "TJ Holowaychuk <tj@vision-media.ca>",
"maintainers": [
"Forbes Lindesay <forbes@lindesay.co.uk>",
"Matthias Le Brun <mlbli@me.com>",
"Joshua Appelman <joshua@jbna.nl>",
"Jonathan Ong <jonathanrichardong@gmail.com>",
"Alex Kocharin <alex@kocharin.ru>",
"Hemanth <hemanth.hm@gmail.com>",
"Timothy Gu <timothygu99@gmail.com>",
"Andreas Lubbe <git@lubbe.org>"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/pugjs/pug/tree/master/packages/pug"
},
"main": "lib",
"dependencies": {
"pug-code-gen": "^2.0.2",
"pug-filters": "^3.1.1",
"pug-lexer": "^4.1.0",
"pug-linker": "^3.0.6",
"pug-load": "^2.0.12",
"pug-parser": "^5.0.1",
"pug-runtime": "^2.0.5",
"pug-strip-comments": "^1.0.4"
},
"devDependencies": {
"jstransformer-cdata": "^1.0.0",
"jstransformer-coffee-script": "^1.0.0",
"jstransformer-less": "^2.1.0",
"jstransformer-markdown-it": "^2.0.0",
"jstransformer-stylus": "^1.0.0",
"jstransformer-uglify-js": "^1.1.1",
"jstransformer-verbatim": "^1.0.0",
"mkdirp": "^0.5.1",
"rimraf": "^3.0.2",
"uglify-js": "github:mishoo/UglifyJS2#1c15d0db456ce32f1b9b507aad97e5ee5c8285f7"
},
"files": [
"lib/index.js",
"register.js"
],
"browser": {
"fs": false
},
"homepage": "https://pugjs.org"
}
================================================
FILE: packages/pug/register.js
================================================
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;
}
================================================
FILE: packages/pug/support/benchmark.js
================================================
/**
* 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();
================================================
FILE: packages/pug/test/README.md
================================================
# Running Tests
To run tests (with node.js installed) you must complete 2 steps.
## 1 Install dependencies
```
npm install
```
## 2 Run tests
```
npm test
```
================================================
FILE: packages/pug/test/__snapshots__/pug.test.js.snap
================================================
// Jest Snapshot v1, https://goo.gl/fbAQLP
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 = \\""\\";
break;
case 38:
n = \\"&\\";
break;
case 60:
n = \\"<\\";
break;
case 62:
n = \\">\\";
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(e, n, r, t) {
if (!(e instanceof Error)) throw e;
if (!((\\"undefined\\" == typeof window && n) || t))
throw ((e.message += \\" on line \\" + r), e);
var o, a, i, s;
try {
(t = t || require(\\"fs\\").readFileSync(n, { encoding: \\"utf8\\" })),
(o = 3),
(a = t.split(\\"\\\\n\\")),
(i = Math.max(r - o, 0)),
(s = Math.min(a.length, r + o));
} catch (t) {
return (
(e.message += \\" - could not read from \\" + n + \\" (\\" + t.message + \\")\\"),
void pug_rethrow(e, null, r)
);
}
(o = a
.slice(i, s)
.map(function(e, n) {
var t = n + i + 1;
return (t == r ? \\" > \\" : \\" \\") + t + \\"| \\" + e;
})
.join(\\"\\\\n\\")),
(e.path = n);
try {
e.message = (n || \\"Pug\\") + \\":\\" + r + \\"\\\\n\\" + o + \\"\\\\n\\\\n\\" + e.message;
} catch (e) {}
throw e;
}
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;
"
`;
================================================
FILE: packages/pug/test/anti-cases/attrs.unescaped.pug
================================================
script(type='text/x-template')
#user(id!='user-<%= user.id %>')
h1 <%= user.title %>
================================================
FILE: packages/pug/test/anti-cases/case-when.pug
================================================
when 5
.foo
when 6
.bar
================================================
FILE: packages/pug/test/anti-cases/case-without-with.pug
================================================
case foo
.div
================================================
FILE: packages/pug/test/anti-cases/else-condition.pug
================================================
if foo
div
else bar
article
================================================
FILE: packages/pug/test/anti-cases/else-without-if.pug
================================================
else
.foo
================================================
FILE: packages/pug/test/anti-cases/inlining-a-mixin-after-a-tag.pug
================================================
foo()+bar()
================================================
FILE: packages/pug/test/anti-cases/key-char-ending-badly.pug
================================================
div("foo"abc)
================================================
FILE: packages/pug/test/anti-cases/key-ending-badly.pug
================================================
div(foo!~abc)
================================================
FILE: packages/pug/test/anti-cases/mismatched-inline-tag.pug
================================================
//- #1871
p #[strong a}
================================================
FILE: packages/pug/test/anti-cases/mixin-args-syntax-error.pug
================================================
mixin foo(a, b)
+foo('a'b'b')
================================================
FILE: packages/pug/test/anti-cases/mixins-blocks-with-bodies.pug
================================================
mixin foo
block
bar
================================================
FILE: packages/pug/test/anti-cases/multiple-non-nested-tags-on-a-line.pug
================================================
foo()bar
================================================
FILE: packages/pug/test/anti-cases/non-existant-filter.pug
================================================
:not-a-valid-filter
foo bar
================================================
FILE: packages/pug/test/anti-cases/non-mixin-block.pug
================================================
div
block
================================================
FILE: packages/pug/test/anti-cases/open-brace-in-attributes.pug
================================================
div(title=[)
================================================
FILE: packages/pug/test/anti-cases/readme.md
================================================
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).
================================================
FILE: packages/pug/test/anti-cases/self-closing-tag-with-block.pug
================================================
input
| Inputs cannot have content
================================================
FILE: packages/pug/test/anti-cases/self-closing-tag-with-body.pug
================================================
input Input's can't have content
================================================
FILE: packages/pug/test/anti-cases/self-closing-tag-with-code.pug
================================================
input= 'Inputs cannot have code'
================================================
FILE: packages/pug/test/anti-cases/tabs-and-spaces.pug
================================================
div
div
article
================================================
FILE: packages/pug/test/anti-cases/unclosed-interpolated-call.pug
================================================
+#{myMixin
================================================
FILE: packages/pug/test/anti-cases/unclosed-interpolated-tag.pug
================================================
mixin item
block
+item( Contact
================================================
FILE: packages/pug/test/anti-cases/unclosed-interpolation.pug
================================================
#{myMixin
================================================
FILE: packages/pug/test/browser/index.html
================================================
<!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>
================================================
FILE: packages/pug/test/browser/index.pug
================================================
!!! 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)
================================================
FILE: packages/pug/test/cases/attrs-data.html
================================================
<foo data-user="{"name":"tobi"}"></foo>
<foo data-items="[1,2,3]"></foo>
<foo data-username="tobi"></foo>
<foo data-escaped="{"message":"Let's rock!"}"></foo>
<foo data-ampersand="{"message":"a quote: &quot; this & that"}"></foo>
<foo data-epoc="1970-01-01T00:00:00.000Z"></foo>
================================================
FILE: packages/pug/test/cases/attrs-data.pug
================================================
- 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: " this & that"})
foo(data-epoc=new Date(0))
================================================
FILE: packages/pug/test/cases/attrs.colon.html
================================================
<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>
================================================
FILE: packages/pug/test/cases/attrs.colon.pug
================================================
//- 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!
================================================
FILE: packages/pug/test/cases/attrs.html
================================================
<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>
================================================
FILE: packages/pug/test/cases/attrs.js.html
================================================
<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>
================================================
FILE: packages/pug/test/cases/attrs.js.pug
================================================
- 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'})
================================================
FILE: packages/pug/test/cases/attrs.pug
================================================
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')
================================================
FILE: packages/pug/test/cases/attrs.unescaped.html
================================================
<script type="text/x-template">
<div id="user-<%= user.id %>">
<h1><%= user.title %></h1>
</div>
</script>
================================================
FILE: packages/pug/test/cases/attrs.unescaped.pug
================================================
script(type='text/x-template')
div(id!='user-<%= user.id %>')
h1 <%= user.title %>
================================================
FILE: packages/pug/test/cases/auxiliary/1794-extends.pug
================================================
block content
================================================
FILE: packages/pug/test/cases/auxiliary/1794-include.pug
================================================
mixin test()
.test&attributes(attributes)
+test()
================================================
FILE: packages/pug/test/cases/auxiliary/blocks-in-blocks-layout.pug
================================================
doctype html
html
head
title Default title
body
block body
.container
block content
================================================
FILE: packages/pug/test/cases/auxiliary/dialog.pug
================================================
extends window.pug
block window-content
.dialog
block content
================================================
FILE: packages/pug/test/cases/auxiliary/empty-block.pug
================================================
block test
================================================
FILE: packages/pug/test/cases/auxiliary/escapes.html
================================================
<script>
console.log("foo\nbar")
</script>
================================================
FILE: packages/pug/test/cases/auxiliary/extends-empty-block-1.pug
================================================
extends empty-block.pug
block test
div test1
================================================
FILE: packages/pug/test/cases/auxiliary/extends-empty-block-2.pug
================================================
extends empty-block.pug
block test
div test2
================================================
FILE: packages/pug/test/cases/auxiliary/extends-from-root.pug
================================================
extends /auxiliary/layout.pug
block content
include /auxiliary/include-from-root.pug
================================================
FILE: packages/pug/test/cases/auxiliary/extends-relative.pug
================================================
extends ../../cases/auxiliary/layout
block content
include ../../cases/auxiliary/include-from-root
================================================
FILE: packages/pug/test/cases/auxiliary/filter-in-include.pug
================================================
html
head
style(type="text/css")
:less
@pad: 15px;
body {
padding: @pad;
}
================================================
FILE: packages/pug/test/cases/auxiliary/includable.js
================================================
var STRING_SUBSTITUTIONS = {
// table of character substitutions
'\t': '\\t',
'\r': '\\r',
'\n': '\\n',
'"': '\\"',
'\\': '\\\\',
};
================================================
FILE: packages/pug/test/cases/auxiliary/include-from-root.pug
================================================
h1 hello
================================================
FILE: packages/pug/test/cases/auxiliary/inheritance.extend.mixin.block.pug
================================================
mixin article()
article
block
html
head
title My Application
block head
body
+article
block content
================================================
FILE: packages/pug/test/cases/auxiliary/inheritance.extend.recursive-grand-grandparent.pug
================================================
h1 grand-grandparent
block grand-grandparent
================================================
FILE: packages/pug/test/cases/auxiliary/inheritance.extend.recursive-grandparent.pug
================================================
extends inheritance.extend.recursive-grand-grandparent.pug
block grand-grandparent
h2 grandparent
block grandparent
================================================
FILE: packages/pug/test/cases/auxiliary/inheritance.extend.recursive-parent.pug
================================================
extends inheritance.extend.recursive-grandparent.pug
block grandparent
h3 parent
block parent
================================================
FILE: packages/pug/test/cases/auxiliary/layout.include.pug
================================================
html
head
title My Application
block head
body
block content
include window.pug
================================================
FILE: packages/pug/test/cases/auxiliary/layout.pug
================================================
html
head
title My Application
block head
body
block content
================================================
FILE: packages/pug/test/cases/auxiliary/mixin-at-end-of-file.pug
================================================
mixin slide
section.slide
block
================================================
FILE: packages/pug/test/cases/auxiliary/mixins.pug
================================================
mixin foo()
p bar
================================================
FILE: packages/pug/test/cases/auxiliary/pet.pug
================================================
.pet
h1 {{name}}
p {{name}} is a {{species}} that is {{age}} old
================================================
FILE: packages/pug/test/cases/auxiliary/smile.html
================================================
<p>:)</p>
================================================
FILE: packages/pug/test/cases/auxiliary/window.pug
================================================
.window
a(href='#').close Close
block window-content
================================================
FILE: packages/pug/test/cases/auxiliary/yield-nested.pug
================================================
html
head
title
body
h1 Page
#content
#content-wrapper
yield
#footer
stuff
================================================
FILE: packages/pug/test/cases/basic.html
================================================
<html>
<body>
<h1>Title</h1>
</body>
</html>
================================================
FILE: packages/pug/test/cases/basic.pug
================================================
html
body
h1 Title
================================================
FILE: packages/pug/test/cases/blanks.html
================================================
<ul>
<li>foo</li>
<li>bar</li>
<li>baz</li>
</ul>
================================================
FILE: packages/pug/test/cases/blanks.pug
================================================
ul
li foo
li bar
li baz
================================================
FILE: packages/pug/test/cases/block-code.html
================================================
<li>Uno</li>
<li>Dos</li>
<li>Tres</li>
<li>Cuatro</li>
<li>Cinco</li>
<li>Seis</li>
================================================
FILE: packages/pug/test/cases/block-code.pug
================================================
-
list = ["uno", "dos", "tres",
"cuatro", "cinco", "seis"];
//- Without a block, the element is accepted and no code is generated
-
each item in list
-
string = item.charAt(0)
.toUpperCase() +
item.slice(1);
li= string
================================================
FILE: packages/pug/test/cases/block-expansion.html
================================================
<ul>
<li><a href="#">foo</a></li>
<li><a href="#">bar</a></li>
</ul>
<p>baz</p>
================================================
FILE: packages/pug/test/cases/block-expansion.pug
================================================
ul
li: a(href='#') foo
li: a(href='#') bar
p baz
================================================
FILE: packages/pug/test/cases/block-expansion.shorthands.html
================================================
<ul>
<li class="list-item">
<div class="foo">
<div id="bar">baz</div>
</div>
</li>
</ul>
================================================
FILE: packages/pug/test/cases/block-expansion.shorthands.pug
================================================
ul
li.list-item: .foo: #bar baz
================================================
FILE: packages/pug/test/cases/blockquote.html
================================================
<figure>
<blockquote>Try to define yourself by what you do, and you’ll burnout every time. You are. That is enough. I rest in that.</blockquote>
<figcaption>from @thefray at 1:43pm on May 10</figcaption>
</figure>
================================================
FILE: packages/pug/test/cases/blockquote.pug
================================================
figure
blockquote
| Try to define yourself by what you do, and you’ll burnout every time. You are. That is enough. I rest in that.
figcaption from @thefray at 1:43pm on May 10
================================================
FILE: packages/pug/test/cases/blocks-in-blocks.html
================================================
<!DOCTYPE html>
<html>
<head>
<title>Default title</title>
</head>
<body>
<h1>Page 2</h1>
</body>
</html>
================================================
FILE: packages/pug/test/cases/blocks-in-blocks.pug
================================================
extends ./auxiliary/blocks-in-blocks-layout.pug
block body
h1 Page 2
================================================
FILE: packages/pug/test/cases/blocks-in-if.html
================================================
<p>ajax contents</p>
================================================
FILE: packages/pug/test/cases/blocks-in-if.pug
================================================
//- see https://github.com/pugjs/pug/issues/1589
-var ajax = true
-if( ajax )
//- return only contents if ajax requests
block contents
p ajax contents
-else
//- return all html
doctype html
html
head
meta( charset='utf8' )
title sample
body
block contents
p all contetns
================================================
FILE: packages/pug/test/cases/case-blocks.html
================================================
<html>
<body>
<p>you have a friend</p>
</body>
</html>
================================================
FILE: packages/pug/test/cases/case-blocks.pug
================================================
html
body
- var friends = 1
case friends
when 0
p you have no friends
when 1
p you have a friend
default
p you have #{friends} friends
================================================
FILE: packages/pug/test/cases/case.html
================================================
<html>
<body>
<p>you have a friend</p>
<p>you have very few friends</p>
<p>Friend is a string</p>
</body>
</html>
================================================
FILE: packages/pug/test/cases/case.pug
================================================
html
body
- var friends = 1
case friends
when 0: p you have no friends
when 1: p you have a friend
default: p you have #{friends} friends
- var friends = 0
case friends
when 0
when 1
p you have very few friends
default
p you have #{friends} friends
- var friend = 'Tim:G'
case friend
when 'Tim:G': p Friend is a string
when {tim: 'g'}: p Friend is an object
================================================
FILE: packages/pug/test/cases/classes-empty.html
================================================
<a></a><a></a><a></a>
================================================
FILE: packages/pug/test/cases/classes-empty.pug
================================================
a(class='')
a(class=null)
a(class=undefined)
================================================
FILE: packages/pug/test/cases/classes.html
================================================
<a class="foo bar baz"></a><a class="foo bar baz"></a><a class="foo-bar_baz"></a><a class="foo baz"></a>
================================================
FILE: packages/pug/test/cases/classes.pug
================================================
a(class=['foo', 'bar', 'baz'])
a.foo(class='bar').baz
a.foo-bar_baz
a(class={foo: true, bar: false, baz: true})
================================================
FILE: packages/pug/test/cases/code.conditionals.html
================================================
<p>foo</p>
<p>foo</p>
<p>foo</p>
<p>bar</p>
<p>baz</p>
<p>bar</p>
<p>yay</p>
<div class="bar"></div>
<div class="bar"></div>
<div class="bing"></div>
<div class="foo"></div>
================================================
FILE: packages/pug/test/cases/code.conditionals.pug
================================================
- if (true)
p foo
- else
p bar
- if (true) {
p foo
- } else {
p bar
- }
if true
p foo
p bar
p baz
else
p bar
unless true
p foo
else
p bar
if 'nested'
if 'works'
p yay
//- allow empty blocks
if false
else
.bar
if true
.bar
else
.bing
if false
.bing
else if false
.bar
else
.foo
================================================
FILE: packages/pug/test/cases/code.escape.html
================================================
<p><script></p>
<p><script></p>
================================================
FILE: packages/pug/test/cases/code.escape.pug
================================================
p= '<script>'
p!= '<script>'
================================================
FILE: packages/pug/test/cases/code.html
================================================
<p></p>
<p></p>
<p></p>
<p>0</p>
<p>false</p>
<p></p>
<p></p>
<p foo=""></p>
<p foo="0"></p>
<p></p>
================================================
FILE: packages/pug/test/cases/code.iteration.html
================================================
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
<ul>
<li class="item-0">1</li>
<li class="item-1">2</li>
<li class="item-2">3</li>
</ul>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
<ul>
<li>1: a</li>
<li>2: a</li>
<li>3: a</li>
<li>1: b</li>
<li>2: b</li>
<li>3: b</li>
<li>1: c</li>
<li>2: c</li>
<li>3: c</li>
</ul>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
================================================
FILE: packages/pug/test/cases/code.iteration.pug
================================================
- var items = [1,2,3]
ul
- items.forEach(function(item){
li= item
- })
- var items = [1,2,3]
ul
for item, i in items
li(class='item-' + i)= item
ul
each item, i in items
li= item
ul
each $item in items
li= $item
- var nums = [1, 2, 3]
- var letters = ['a', 'b', 'c']
ul
for l in letters
for n in nums
li #{n}: #{l}
- var count = 1
- var counter = function() { return [count++, count++, count++] }
ul
for n in counter()
li #{n}
================================================
FILE: packages/pug/test/cases/code.pug
================================================
p= null
p= undefined
p= ''
p= 0
p= false
p(foo=null)
p(foo=undefined)
p(foo='')
p(foo=0)
p(foo=false)
================================================
FILE: packages/pug/test/cases/comments-in-case.html
================================================
<!DOCTYPE html>
<html>
<body>
<p>It's this!</p>
</body>
</html>
================================================
FILE: packages/pug/test/cases/comments-in-case.pug
================================================
doctype html
html
body
- var s = 'this'
case s
//- Comment
when 'this'
p It's this!
when 'that'
p It's that!
================================================
FILE: packages/pug/test/cases/comments.html
================================================
<!-- foo-->
<ul>
<!-- bar-->
<li>one</li>
<!-- baz-->
<li>two</li>
</ul>
<!--
ul
li foo
-->
<!-- block
// inline follow
li three
-->
<!-- block
// inline followed by tags
ul
li four
-->
<!--if IE lt 9
// inline
script(src='/lame.js')
// end-inline
-->
<p>five</p>
<div class="foo">// not a comment</div>
================================================
FILE: packages/pug/test/cases/comments.pug
================================================
// foo
ul
// bar
li one
// baz
li two
//
ul
li foo
// block
// inline follow
li three
// block
// inline followed by tags
ul
li four
//if IE lt 9
// inline
script(src='/lame.js')
// end-inline
p five
.foo // not a comment
================================================
FILE: packages/pug/test/cases/comments.source.html
================================================
================================================
FILE: packages/pug/test/cases/comments.source.pug
================================================
//-
s/s.
//- test/cases/comments.source.pug
//-
test/cases/comments.source.pug
when
()
================================================
FILE: packages/pug/test/cases/doctype.custom.html
================================================
<!DOCTYPE custom stuff>
================================================
FILE: packages/pug/test/cases/doctype.custom.pug
================================================
doctype custom stuff
================================================
FILE: packages/pug/test/cases/doctype.default.html
================================================
<!DOCTYPE html>
<html>
<body>
<h1>Title</h1>
</body>
</html>
================================================
FILE: packages/pug/test/cases/doctype.default.pug
================================================
doctype
html
body
h1 Title
================================================
FILE: packages/pug/test/cases/doctype.keyword.html
================================================
<!DOCTYPE html>
================================================
FILE: packages/pug/test/cases/doctype.keyword.pug
================================================
doctype html
================================================
FILE: packages/pug/test/cases/each.else.html
================================================
<ul>
<li>no users!</li>
</ul>
<ul>
<li>tobi</li>
<li>loki</li>
</ul>
<ul>
<li>name: tobi</li>
<li>age: 10</li>
</ul>
<ul>
<li>user has no details!</li>
</ul>
<ul>
<li>name: tobi</li>
</ul>
================================================
FILE: packages/pug/test/cases/each.else.pug
================================================
- var users = []
ul
for user in users
li= user.name
else
li no users!
- var users = [{ name: 'tobi', friends: ['loki'] }, { name: 'loki' }]
if users
ul
for user in users
li= user.name
else
li no users!
- var user = { name: 'tobi', age: 10 }
ul
each val, key in user
li #{key}: #{val}
else
li user has no details!
- var user = {}
ul
each prop, key in user
li #{key}: #{val}
else
li user has no details!
- var user = Object.create(null)
- user.name = 'tobi'
ul
each val, key in user
li #{key}: #{val}
else
li user has no details!
================================================
FILE: packages/pug/test/cases/escape-chars.html
================================================
<script>var re = /\d+/;</script>
================================================
FILE: packages/pug/test/cases/escape-chars.pug
================================================
script.
var re = /\d+/;
================================================
FILE: packages/pug/test/cases/escape-test.html
================================================
<!DOCTYPE html>
<html>
<head>
<title>escape-test</title>
</head>
<body>
<textarea><param name="flashvars" value="a=&quot;value_a&quot;&b=&quot;value_b&quot;&c=3"/></textarea>
</body>
</html>
================================================
FILE: packages/pug/test/cases/escape-test.pug
================================================
doctype html
html
head
title escape-test
body
textarea
- var txt = '<param name="flashvars" value="a="value_a"&b="value_b"&c=3"/>'
| #{txt}
================================================
FILE: packages/pug/test/cases/escaping-class-attribute.html
================================================
<foo attr="<%= bar %>"></foo>
<foo class="<%= bar %>"></foo>
<foo attr="<%= bar %>"></foo>
<foo class="<%= bar %>"></foo>
<foo class="<%= bar %> lol rofl"></foo>
<foo class="<%= bar %> lol rofl <%= lmao %>"></foo>
================================================
FILE: packages/pug/test/cases/escaping-class-attribute.pug
================================================
foo(attr="<%= bar %>")
foo(class="<%= bar %>")
foo(attr!="<%= bar %>")
foo(class!="<%= bar %>")
foo(class!="<%= bar %> lol rofl")
foo(class!="<%= bar %> lol rofl <%= lmao %>")
================================================
FILE: packages/pug/test/cases/filter-in-include.html
================================================
<html>
<head><style type="text/css">body {
padding: 15px;
}
</style>
</head>
</html>
================================================
FILE: packages/pug/test/cases/filter-in-include.pug
================================================
include ./auxiliary/filter-in-include.pug
================================================
FILE: packages/pug/test/cases/filters-empty.html
================================================
<fb:users>
<fb:user age="2"><![CDATA[]]>
</fb:user>
</fb:users>
================================================
FILE: packages/pug/test/cases/filters-empty.pug
================================================
- var users = [{ name: 'tobi', age: 2 }]
fb:users
for user in users
fb:user(age=user.age)
:cdata
================================================
FILE: packages/pug/test/cases/filters.coffeescript.html
================================================
<script type="text/javascript">
(function() {
var regexp;
regexp = /\n/;
}).call(this);
(function(){}).call(this);
</script>
================================================
FILE: packages/pug/test/cases/filters.coffeescript.pug
================================================
script(type='text/javascript')
:coffee-script
regexp = /\n/
:coffee-script(minify=true)
math =
square: (value) -> value * value
================================================
FILE: packages/pug/test/cases/filters.custom.html
================================================
<html>
<body>BEGINLine 1
Line 2
Line 4END
</body>
</html>
================================================
FILE: packages/pug/test/cases/filters.custom.pug
================================================
html
body
:custom(opt='val' num=2)
Line 1
Line 2
Line 4
================================================
FILE: packages/pug/test/cases/filters.include.custom.html
================================================
<html>
<body>
<pre>BEGINhtml
body
pre
include:custom(opt='val' num=2) filters.include.custom.pug
END</pre>
</body>
</html>
================================================
FILE: packages/pug/test/cases/filters.include.custom.pug
================================================
html
body
pre
include:custom(opt='val' num=2) filters.include.custom.pug
================================================
FILE: packages/pug/test/cases/filters.include.html
================================================
<html>
<body><p>Just <em>some</em> markdown <strong>tests</strong>.</p>
<p>With new line.</p>
<script>(function(){}).call(this);</script>
<script>(function() {
var math;
math = {
square: function(value) {
return value * value;
}
};
}).call(this);
</script>
</body>
</html>
================================================
FILE: packages/pug/test/cases/filters.include.pug
================================================
html
body
include:markdown-it some.md
script
include:coffee-script(minify=true) include-filter-coffee.coffee
script
include:coffee-script(minify=false) include-filter-coffee.coffee
================================================
FILE: packages/pug/test/cases/filters.inline.html
================================================
<p>
before <![CDATA[inside]]> after</p>
================================================
FILE: packages/pug/test/cases/filters.inline.pug
================================================
p before #[:cdata inside] after
================================================
FILE: packages/pug/test/cases/filters.less.html
================================================
<html>
<head><style type="text/css">body {
padding: 15px;
}
</style>
</head>
</html>
================================================
FILE: packages/pug/test/cases/filters.less.pug
================================================
html
head
style(type="text/css")
:less
@pad: 15px;
body {
padding: @pad;
}
================================================
FILE: packages/pug/test/cases/filters.markdown.html
================================================
<html>
<body><p>This is <em>some</em> awesome <strong>markdown</strong>
whoop.</p>
</body>
</html>
================================================
FILE: packages/pug/test/cases/filters.markdown.pug
================================================
html
body
:markdown
This is _some_ awesome **markdown**
whoop.
================================================
FILE: packages/pug/test/cases/filters.nested.html
================================================
<script><![CDATA[!function(){console.log("test")}();]]></script>
<script><![CDATA[(function(){!function(){console.log("test")}()}).call(this);]]></script>
================================================
FILE: packages/pug/test/cases/filters.nested.pug
================================================
script
:cdata:uglify-js
(function() {
console.log('test')
})()
script
:cdata:uglify-js:coffee-script
(->
console.log 'test'
)()
================================================
FILE: packages/pug/test/cases/filters.stylus.html
================================================
<html>
<head><style type="text/css">body {
padding: 50px;
}
</style>
</head>
<body></body>
</html>
================================================
FILE: packages/pug/test/cases/filters.stylus.pug
================================================
html
head
style(type="text/css")
:stylus
body
padding: 50px
body
================================================
FILE: packages/pug/test/cases/html.html
================================================
<ul>
<li>foo</li>
<li>bar</li>
<li>baz</li>
</ul>
<!--build:js /js/app.min.js?v=1449104952939-->
<!--endbuild-->
<p>You can <em>embed</em> html as well.</p>
<p><strong>Even</strong> as the body of a block expansion.</p>
================================================
FILE: packages/pug/test/cases/html.pug
================================================
- var version = 1449104952939
<ul>
<li>foo</li>
<li>bar</li>
<li>baz</li>
</ul>
<!--build:js /js/app.min.js?v=#{version}-->
<!--endbuild-->
p You can <em>embed</em> html as well.
p: <strong>Even</strong> as the body of a block expansion.
================================================
FILE: packages/pug/test/cases/html5.html
================================================
<!DOCTYPE html>
<input type="checkbox" checked>
<input type="checkbox" checked>
<input type="checkbox">
================================================
FILE: packages/pug/test/cases/html5.pug
================================================
doctype html
input(type='checkbox', checked)
input(type='checkbox', checked=true)
input(type='checkbox', checked=false)
================================================
FILE: packages/pug/test/cases/include-extends-from-root.html
================================================
<html>
<head>
<title>My Application</title>
</head>
<body>
<h1>hello</h1>
</body>
</html>
================================================
FILE: packages/pug/test/cases/include-extends-from-root.pug
================================================
include /auxiliary/extends-from-root.pug
================================================
FILE: packages/pug/test/cases/include-extends-of-common-template.html
================================================
<div>test1</div>
<div>test2</div>
================================================
FILE: packages/pug/test/cases/include-extends-of-common-template.pug
================================================
include auxiliary/extends-empty-block-1.pug
include auxiliary/extends-empty-block-2.pug
================================================
FILE: packages/pug/test/cases/include-extends-relative.html
================================================
<html>
<head>
<title>My Application</title>
</head>
<body>
<h1>hello</h1>
</body>
</html>
================================================
FILE: packages/pug/test/cases/include-extends-relative.pug
================================================
include ../cases/auxiliary/extends-relative.pug
================================================
FILE: packages/pug/test/cases/include-filter-coffee.coffee
================================================
math =
square: (value) -> value * value
================================================
FILE: packages/pug/test/cases/include-only-text-body.html
================================================
The message is ""
================================================
FILE: packages/pug/test/cases/include-only-text-body.pug
================================================
| The message is "
yield
| "
================================================
FILE: packages/pug/test/cases/include-only-text.html
================================================
<html>
<body>
<p>The message is "<em>hello world</em>"</p>
</body>
</html>
================================================
FILE: packages/pug/test/cases/include-only-text.pug
================================================
html
body
p
include include-only-text-body.pug
em hello world
================================================
FILE: packages/pug/test/cases/include-with-text-head.html
================================================
<head>
<script type="text/javascript">alert('hello world');</script>
</head>
================================================
FILE: packages/pug/test/cases/include-with-text-head.pug
================================================
head
script(type='text/javascript').
alert('hello world');
================================================
FILE: packages/pug/test/cases/include-with-text.html
================================================
<html>
<head>
<script type="text/javascript">alert('hello world');</script>
<script src="/caustic.js"></script>
<script src="/app.js"></script>
</head>
</html>
================================================
FILE: packages/pug/test/cases/include-with-text.pug
================================================
html
include include-with-text-head.pug
script(src='/caustic.js')
script(src='/app.js')
================================================
FILE: packages/pug/test/cases/include.script.html
================================================
<script id="pet-template" type="text/x-template">
<div class="pet">
<h1>{{name}}</h1>
<p>{{name}} is a {{species}} that is {{age}} old</p>
</div>
</script>
================================================
FILE: packages/pug/test/cases/include.script.pug
================================================
script#pet-template(type='text/x-template')
include auxiliary/pet.pug
================================================
FILE: packages/pug/test/cases/include.yield.nested.html
================================================
<html>
<head>
<title></title>
</head>
<body>
<h1>Page</h1>
<div id="content">
<div id="content-wrapper">
<p>some content</p>
<p>and some more</p>
</div>
</div>
<div id="footer">
<stuff></stuff>
</div>
</body>
</html>
================================================
FILE: packages/pug/test/cases/include.yield.nested.pug
================================================
include auxiliary/yield-nested.pug
p some content
p and some more
================================================
FILE: packages/pug/test/cases/includes-with-ext-js.html
================================================
<pre><code>var x = '\n here is some \n new lined text';
</code></pre>
================================================
FILE: packages/pug/test/cases/includes-with-ext-js.pug
================================================
pre
code
include javascript-new-lines.js
================================================
FILE: packages/pug/test/cases/includes.html
================================================
<p>bar</p>
<body>
<p>:)</p><script>
console.log("foo\nbar")
</script>
<script type="text/javascript">
var STRING_SUBSTITUTIONS = {
// table of character substitutions
'\t': '\\t',
'\r': '\\r',
'\n': '\\n',
'"': '\\"',
'\\': '\\\\',
};
</script>
</body>
================================================
FILE: packages/pug/test/cases/includes.pug
================================================
include auxiliary/mixins.pug
+foo
body
include auxiliary/smile.html
include auxiliary/escapes.html
script(type="text/javascript")
include:verbatim auxiliary/includable.js
================================================
FILE: packages/pug/test/cases/inheritance.alert-dialog.html
================================================
<div class="window"><a class="close" href="#">Close</a>
<div class="dialog">
<h1>Alert!</h1>
<p>I'm an alert!</p>
</div>
</div>
================================================
FILE: packages/pug/test/cases/inheritance.alert-dialog.pug
================================================
extends auxiliary/dialog.pug
block content
h1 Alert!
p I'm an alert!
================================================
FILE: packages/pug/test/cases/inheritance.defaults.html
================================================
<html>
<head>
<script src="jquery.js"></script>
<script src="keymaster.js"></script>
<script src="caustic.js"></script>
</head>
</html>
================================================
FILE: packages/pug/test/cases/inheritance.defaults.pug
================================================
html
head
block head
script(src='jquery.js')
script(src='keymaster.js')
script(src='caustic.js')
================================================
FILE: packages/pug/test/cases/inheritance.extend.html
================================================
<html>
<head>
<title>My Application</title>
<script src="jquery.js"></script>
</head>
<body>
<h2>Page</h2>
<p>Some content</p>
</body>
</html>
================================================
FILE: packages/pug/test/cases/inheritance.extend.include.html
================================================
<html>
<head>
<title>My Application</title>
<script src="jquery.js"></script>
</head>
<body>
<h2>Page</h2>
<p>Some content</p>
<div class="window"><a class="close" href="#">Close</a>
<h2>Awesome</h2>
<p>Now we can extend included blocks!</p>
</div>
</body>
</html>
================================================
FILE: packages/pug/test/cases/inheritance.extend.include.pug
================================================
extend auxiliary/layout.include.pug
block head
script(src='jquery.js')
block content
h2 Page
p Some content
block window-content
h2 Awesome
p Now we can extend included blocks!
================================================
FILE: packages/pug/test/cases/inheritance.extend.mixins.block.html
================================================
<html>
<head>
<title>My Application</title>
</head>
<body>
<article>
<p>Hello World!</p>
</article>
</body>
</html>
================================================
FILE: packages/pug/test/cases/inheritance.extend.mixins.block.pug
================================================
extend auxiliary/inheritance.extend.mixin.block.pug
block content
p Hello World!
================================================
FILE: packages/pug/test/cases/inheritance.extend.mixins.html
================================================
<html>
<head>
<title>My Application</title>
</head>
<body>
<h1>The meaning of life</h1>
<p>Foo bar baz!</p>
</body>
</html>
================================================
FILE: packages/pug/test/cases/inheritance.extend.mixins.pug
================================================
extend auxiliary/layout.pug
mixin article(title)
if title
h1= title
block
block content
+article("The meaning of life")
p Foo bar baz!
================================================
FILE: packages/pug/test/cases/inheritance.extend.pug
================================================
extend auxiliary/layout.pug
block head
script(src='jquery.js')
block content
h2 Page
p Some content
================================================
FILE: packages/pug/test/cases/inheritance.extend.recursive.html
================================================
<h1>grand-grandparent</h1>
<h2>grandparent</h2>
<h3>parent</h3>
<h4>child</h4>
================================================
FILE: packages/pug/test/cases/inheritance.extend.recursive.pug
================================================
extends /auxiliary/inheritance.extend.recursive-parent.pug
block parent
h4 child
================================================
FILE: packages/pug/test/cases/inheritance.extend.whitespace.html
================================================
<html>
<head>
<title>My Application</title>
<script src="jquery.js"></script>
</head>
<body>
<h2>Page</h2>
<p>Some content</p>
</body>
</html>
================================================
FILE: packages/pug/test/cases/inheritance.extend.whitespace.pug
================================================
extend auxiliary/layout.pug
block head
script(src='jquery.js')
block content
h2 Page
p Some content
================================================
FILE: packages/pug/test/cases/inheritance.html
================================================
<html>
<head>
<title>My Application</title>
<script src="jquery.js"></script>
</head>
<body>
<h2>Page</h2>
<p>Some content</p>
</body>
</html>
================================================
FILE: packages/pug/test/cases/inheritance.pug
================================================
extends auxiliary/layout.pug
block head
script(src='jquery.js')
block content
h2 Page
p Some content
================================================
FILE: packages/pug/test/cases/inline-tag.html
================================================
<p>bing <strong>foo</strong> bong</p>
<p>
bing
<strong>foo</strong>
<strong>[foo]</strong>
bong
</p>
<p>
bing
<strong>foo</strong>
<strong>[foo]</strong>
bong
</p>
<p>
#[strong escaped]
#[<strong>escaped</strong>
</p>
================================================
FILE: packages/pug/test/cases/inline-tag.pug
================================================
p bing #[strong foo] bong
p.
bing
#[strong foo]
#[strong= '[foo]']
#[- var foo = 'foo]']
bong
p
| bing
| #[strong foo]
| #[strong= '[foo]']
| #[- var foo = 'foo]']
| bong
p.
\#[strong escaped]
\#[#[strong escaped]
================================================
FILE: packages/pug/test/cases/intepolated-elements.html
================================================
<p><a class="rho rho--modifier" href="#">with inline link</a></p>
<p>Some text <a class="rho rho--modifier" href="#"></a></p>
<p>Some text <a class="rho rho--modifier" href="#">with inline link</a></p>
================================================
FILE: packages/pug/test/cases/intepolated-elements.pug
================================================
p #[a.rho(href='#', class='rho--modifier') with inline link]
p Some text #[a.rho(href='#', class='rho--modifier')]
p Some text #[a.rho(href='#', class='rho--modifier') with inline link]
================================================
FILE: packages/pug/test/cases/interpolated-mixin.html
================================================
<p>This also works <a href="http://www.bing.com">http://www.bing.com</a> so hurrah for Pug
</p>
================================================
FILE: packages/pug/test/cases/interpolated-mixin.pug
================================================
mixin linkit(url)
a(href=url)= url
p This also works #[+linkit('http://www.bing.com')] so hurrah for Pug
================================================
FILE: packages/pug/test/cases/interpolation.escape.html
================================================
<foo>
some
#{text}
here
My ID is {42}
</foo>
================================================
FILE: packages/pug/test/cases/interpolation.escape.pug
================================================
- var id = 42;
foo
| some
| \#{text}
| here
| My ID #{"is {" + id + "}"}
================================================
FILE: packages/pug/test/cases/javascript-new-lines.js
================================================
var x = '\n here is some \n new lined text';
================================================
FILE: packages/pug/test/cases/layout.append.html
================================================
<html>
<script src="vendor/jquery.js"></script>
<script src="vendor/caustic.js"></script>
<script src="app.js"></script>
<script src="foo.js"></script>
<script src="bar.js"></script>
<body>
</body>
</html>
================================================
FILE: packages/pug/test/cases/layout.append.pug
================================================
extends ../fixtures/append/app-layout.pug
block append head
script(src='foo.js')
script(src='bar.js')
================================================
FILE: packages/pug/test/cases/layout.append.without-block.html
================================================
<html>
<script src="vendor/jquery.js"></script>
<script src="vendor/caustic.js"></script>
<script src="app.js"></script>
<script src="foo.js"></script>
<script src="bar.js"></script>
<body>
</body>
</html>
================================================
FILE: packages/pug/test/cases/layout.append.without-block.pug
================================================
extends ../fixtures/append-without-block/app-layout.pug
append head
script(src='foo.js')
script(src='bar.js')
================================================
FILE: packages/pug/test/cases/layout.multi.append.prepend.block.html
================================================
<p class="last prepend">Last prepend must appear at top</p>
<p class="first prepend">Something prepended to content</p>
<div class="content">Defined content</div>
<p class="first append">Something appended to content</p>
<p class="last append">Last append must be most last</p>
<script src="foo.js"></script>
<script src="/app.js"></script>
<script src="jquery.js"></script>
================================================
FILE: packages/pug/test/cases/layout.multi.append.prepend.block.pug
================================================
extends ../fixtures/multi-append-prepend-block/redefine.pug
append content
p.first.append Something appended to content
prepend content
p.first.prepend Something prepended to content
append content
p.last.append Last append must be most last
prepend content
p.last.prepend Last prepend must appear at top
append head
script(src='jquery.js')
prepend head
script(src='foo.js')
================================================
FILE: packages/pug/test/cases/layout.prepend.html
================================================
<html>
<script src="foo.js"></script>
<script src="bar.js"></script>
<script src="app.js"></script>
<script src="vendor/jquery.js"></script>
<script src="vendor/caustic.js"></script>
<body>
</body>
</html>
================================================
FILE: packages/pug/test/cases/layout.prepend.pug
================================================
extends ../fixtures/prepend/app-layout.pug
block prepend head
script(src='foo.js')
script(src='bar.js')
================================================
FILE: packages/pug/test/cases/layout.prepend.without-block.html
================================================
<html>
<script src="foo.js"></script>
<script src="bar.js"></script>
<script src="app.js"></script>
<script src="vendor/jquery.js"></script>
<script src="vendor/caustic.js"></script>
<body>
</body>
</html>
================================================
FILE: packages/pug/test/cases/layout.prepend.without-block.pug
================================================
extends ../fixtures/prepend-without-block/app-layout.pug
prepend head
script(src='foo.js')
script(src='bar.js')
================================================
FILE: packages/pug/test/cases/mixin-at-end-of-file.html
================================================
<section class="slide">
<p>some awesome content</p>
</section>
================================================
FILE: packages/pug/test/cases/mixin-at-end-of-file.pug
================================================
include ./auxiliary/mixin-at-end-of-file.pug
+slide()
p some awesome content
================================================
FILE: packages/pug/test/cases/mixin-block-with-space.html
================================================
<div>This text should appear
</div>
================================================
FILE: packages/pug/test/cases/mixin-block-with-space.pug
================================================
mixin m(id)
div
block
+m()
| This text should appear
================================================
FILE: packages/pug/test/cases/mixin-hoist.html
================================================
<html>
<body>
<h1>Pug</h1>
</body>
</html>
================================================
FILE: packages/pug/test/cases/mixin-hoist.pug
================================================
mixin foo()
h1= title
html
body
+foo
================================================
FILE: packages/pug/test/cases/mixin-via-include.html
================================================
<p>bar</p>
================================================
FILE: packages/pug/test/cases/mixin-via-include.pug
================================================
//- regression test for https://github.com/pugjs/pug/issues/1435
include ../fixtures/mixin-include.pug
+bang
================================================
FILE: packages/pug/test/cases/mixin.attrs.html
================================================
<body>
<div class="centered" id="First">Hello World
</div>
<div class="centered" id="Second">
<h1>Section 1</h1>
<p>Some important content.</p>
</div>
<div class="centered" id="Third">
<h1 class="foo bar">Section 2</h1>
<p>Even more important content.</p>
<div class="footer"><a href="menu.html">Back</a></div>
</div>
<div class="stretch">
<div class="centered">
<h1 class="highlight">Section 3</h1>
<p>Last content.</p>
<div class="footer"><a href="#">Back</a></div>
</div>
</div>
<div class="bottom foo bar" name="end" id="Last" data-attr="baz">
<p>Some final words.</p>
</div>
<div class="bottom class1 class2">
</div>
</body>
<div class="thing foo bar thunk" attr1="foo" attr2="bar" attr3="baz" data-foo="<biz>" data-bar="<biz>"></div>
<div data-profile="profile" data-creator-name="name">work</div>
<div class="thing baz" attr1="foo" attr2="bar" attr3="qux"></div>
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
================================================
FILE: packages/pug/test/cases/mixin.attrs.pug
================================================
mixin centered(title)
div.centered(id=attributes.id)
- if (title)
h1(class=attributes.class)= title
block
- if (attributes.href)
.footer
a(href=attributes.href) Back
mixin main(title)
div.stretch
+centered(title).highlight&attributes(attributes)
block
mixin bottom
div.bottom&attributes(attributes)
block
body
+centered#First Hello World
+centered('Section 1')#Second
p Some important content.
+centered('Section 2')#Third.foo(href='menu.html', class='bar')
p Even more important content.
+main('Section 3')(href='#')
p Last content.
+bottom.foo(class='bar', name='end', id='Last', data-attr='baz')
p Some final words.
+bottom(class=['class1', 'class2'])
mixin foo
div.thing(attr1='foo', attr2='bar')&attributes(attributes)
- var val = '<biz>'
- var classes = ['foo', 'bar']
+foo(attr3='baz' data-foo=val data-bar!=val class=classes).thunk
//- Regression test for #1424
mixin work_filmstrip_item(work)
div&attributes(attributes)= work
+work_filmstrip_item('work')("data-profile"='profile', "data-creator-name"='name')
mixin my-mixin(arg1, arg2, arg3, arg4)
p= arg1
p= arg2
p= arg3
p= arg4
+foo(
attr3="qux"
class="baz"
)
+my-mixin(
'1',
'2',
'3',
'4'
)
================================================
FILE: packages/pug/test/cases/mixin.block-tag-behaviour.html
================================================
<html>
<body>
<section class="article">
<h1>Foo</h1>
<p>I'm article foo</p>
</section>
</body>
</html>
<html>
<body>
<section class="article">
<h1>Something</h1>
<p>
I'm a much longer
text-only article,
but you can still
inline html tags
in me if you want.
</p>
</section>
</body>
</html>
================================================
FILE: packages/pug/test/cases/mixin.block-tag-behaviour.pug
================================================
mixin article(name)
section.article
h1= name
block
html
body
+article('Foo'): p I'm article foo
mixin article(name)
section.article
h1= name
p
block
html
body
+article('Something').
I'm a much longer
text-only article,
but you can still
inline html tags
in me if you want.
================================================
FILE: packages/pug/test/cases/mixin.blocks.html
================================================
<html>
<body>
<form method="GET" action="/search">
<input type="hidden" name="_csrf" value="hey"/>
<input type="text" name="query" placeholder="Search"/>
<input type="submit" value="Search"/>
</form>
</body>
</html>
<html>
<body>
<form method="POST" action="/search">
<input type="hidden" name="_csrf" value="hey"/>
<input type="text" name="query" placeholder="Search"/>
<input type="submit" value="Search"/>
</form>
</body>
</html>
<html>
<body>
<form method="POST" action="/search">
<input type="hidden" name="_csrf" value="hey"/>
</form>
</body>
</html>
<div id="foo">
<div id="bar">
<p>one</p>
<p>two</p>
<p>three</p>
</div>
</div>
<div id="baz">123
</div>
================================================
FILE: packages/pug/test/cases/mixin.blocks.pug
================================================
mixin form(method, action)
form(method=method, action=action)
- var csrf_token_from_somewhere = 'hey'
input(type='hidden', name='_csrf', value=csrf_token_from_somewhere)
block
html
body
+form('GET', '/search')
input(type='text', name='query', placeholder='Search')
input(type='submit', value='Search')
html
body
+form('POST', '/search')
input(type='text', name='query', placeholder='Search')
input(type='submit', value='Search')
html
body
+form('POST', '/search')
mixin bar()
#bar
block
mixin foo()
#foo
+bar
block
+foo
p one
p two
p three
mixin baz
#baz
block
+baz()= '123'
================================================
FILE: packages/pug/test/cases/mixin.merge.html
================================================
<body>
<p class="bar hello">One</p>
<p class="baz quux hello">Two</p>
<p class="hello">Three</p>
<p class="bar baz hello">Four</p>
<p class="bar" id="world">One</p>
<p class="baz quux" id="world">Two</p>
<p id="world">Three</p>
<p class="bar baz" id="world">Four</p>
<p class="bar hello" id="world">One</p>
<p class="baz quux hello" id="world">Two</p>
<p class="hello" id="world">Three</p>
<p class="bar baz hello" id="world">Four</p>
<p class="bar hello world">One</p>
<p class="baz quux hello world">Two</p>
<p class="hello world">Three</p>
<p class="bar baz hello world">Four</p>
<p class="bar hello">One</p>
<p class="baz quux hello">Two</p>
<p class="hello">Three</p>
<p class="bar baz hello">Four</p>
<p class="bar hello world">One</p>
<p class="baz quux hello world">Two</p>
<p class="hello world">Three</p>
<p class="bar baz hello world">Four</p>
<p class="bar">One</p>
<p class="baz quux">Two</p>
<p>Three</p>
<p class="bar baz">Four</p>
<p class="bar hello">One</p>
<p class="baz quux hello">Two</p>
<p class="hello">Three</p>
<p class="bar baz hello">Four</p>
</body>
================================================
FILE: packages/pug/test/cases/mixin.merge.pug
================================================
mixin foo
p.bar&attributes(attributes) One
p.baz.quux&attributes(attributes) Two
p&attributes(attributes) Three
p.bar&attributes(attributes)(class="baz") Four
body
+foo.hello
+foo#world
+foo.hello#world
+foo.hello.world
+foo(class="hello")
+foo.hello(class="world")
+foo
+foo&attributes({class: "hello"})
================================================
FILE: packages/pug/test/cases/mixins-unused.html
================================================
<body></body>
================================================
FILE: packages/pug/test/cases/mixins-unused.pug
================================================
mixin never-called
.wtf This isn't something we ever want to output
body
================================================
FILE: packages/pug/test/cases/mixins.html
================================================
<div id="user">
<h1>Tobi</h1>
<div class="comments">
<div class="comment">
<h2>This</h2>
<p class="body">is regular, javascript</p>
</div>
</div>
</div>
<body>
<ul>
<li>foo</li>
<li>bar</li>
<li>baz</li>
</ul>
<ul>
<li>foo</li>
<li>bar</li>
<li>baz</li>
</ul>
</body>
<div id="interpolation">This is interpolated</div>
================================================
FILE: packages/pug/test/cases/mixins.pug
================================================
mixin comment(title, str)
.comment
h2= title
p.body= str
mixin comment (title, str)
.comment
h2= title
p.body= str
#user
h1 Tobi
.comments
+comment('This',
(('is regular, javascript')))
mixin list
ul
li foo
li bar
li baz
body
+list()
+ list()
mixin foobar(str)
div#interpolation= str + 'interpolated'
- var suffix = "bar"
+#{'foo' + suffix}('This is ')
================================================
FILE: packages/pug/test/cases/mixins.rest-args.html
================================================
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
================================================
FILE: packages/pug/test/cases/mixins.rest-args.pug
================================================
mixin list(tag, ...items)
#{tag}
each item in items
li= item
+list('ul', 1, 2, 3, 4)
================================================
FILE: packages/pug/test/cases/namespaces.html
================================================
<fb:user:role>Something</fb:user:role>
<foo fb:foo="bar"></foo>
================================================
FILE: packages/pug/test/cases/namespaces.pug
================================================
fb:user:role Something
foo(fb:foo='bar')
================================================
FILE: packages/pug/test/cases/nesting.html
================================================
<ul>
<li>a</li>
<li>b</li>
<li>
<ul>
<li>c</li>
<li>d</li>
</ul>
</li>
<li>e</li>
</ul>
================================================
FILE: packages/pug/test/cases/nesting.pug
================================================
ul
li a
li b
li
ul
li c
li d
li e
================================================
FILE: packages/pug/test/cases/pipeless-comments.html
================================================
<!--
.foo
.bar
.hey
-->
================================================
FILE: packages/pug/test/cases/pipeless-comments.pug
================================================
//
.foo
.bar
.hey
================================================
FILE: packages/pug/test/cases/pipeless-filters.html
================================================
<pre><code>code sample
</code></pre><h1>Heading</h1>
================================================
FILE: packages/pug/test/cases/pipeless-filters.pug
================================================
:markdown-it
code sample
# Heading
================================================
FILE: packages/pug/test/cases/pipeless-tag.html
================================================
<pre> what
is going on</pre>
================================================
FILE: packages/pug/test/cases/pipeless-tag.pug
================================================
pre.
what
is #{'going'} #[| #{'on'}]
================================================
FILE: packages/pug/test/cases/pre.html
================================================
<pre>foo
bar
baz
</pre>
<pre><code>foo
bar
baz</code></pre>
================================================
FILE: packages/pug/test/cases/pre.pug
================================================
pre.
foo
bar
baz
pre
code.
foo
bar
baz
================================================
FILE: packages/pug/test/cases/quotes.html
================================================
<p>"foo"</p>
<p>'foo'</p>
================================================
FILE: packages/pug/test/cases/quotes.pug
================================================
p "foo"
p 'foo'
================================================
FILE: packages/pug/test/cases/regression.1794.html
================================================
<div class="test"></div>
================================================
FILE: packages/pug/test/cases/regression.1794.pug
================================================
extends ./auxiliary/1794-extends.pug
block content
include ./auxiliary/1794-include.pug
================================================
FILE: packages/pug/test/cases/regression.784.html
================================================
<div class="url">google.com</div>
================================================
FILE: packages/pug/test/cases/regression.784.pug
================================================
- var url = 'http://www.google.com'
.url #{url.replace('http://', '').replace(/^www\./, '')}
================================================
FILE: packages/pug/test/cases/script.whitespace.html
================================================
<script>
if (foo) {
bar();
}
</script>
================================================
FILE: packages/pug/test/cases/script.whitespace.pug
================================================
script.
if (foo) {
bar();
}
================================================
FILE: packages/pug/test/cases/scripts.html
================================================
<script>
if (foo) {
bar();
}
</script>
<script>foo()</script>
<script>foo()</script>
<script></script>
<div></div>
================================================
FILE: packages/pug/test/cases/scripts.non-js.html
================================================
<script id="user-template" type="text/template">
<div id="user">
<h1><%= user.name %></h1>
<p><%= user.description %></p>
</div>
</script>
<script id="user-template" type="text/template">
if (foo) {
bar();
}
</script>
================================================
FILE: packages/pug/test/cases/scripts.non-js.pug
================================================
script#user-template(type='text/template')
#user
h1 <%= user.name %>
p <%= user.description %>
script#user-template(type='text/template').
if (foo) {
bar();
}
================================================
FILE: packages/pug/test/cases/scripts.pug
================================================
script.
if (foo) {
bar();
}
script!= 'foo()'
script foo()
script
div
================================================
FILE: packages/pug/test/cases/self-closing-html.html
================================================
<!DOCTYPE html>
<html>
<body><br/></body>
</html>
================================================
FILE: packages/pug/test/cases/self-closing-html.pug
================================================
doctype html
html
body
br/
================================================
FILE: packages/pug/test/cases/single-period.html
================================================
<span>.</span>
================================================
FILE: packages/pug/test/cases/single-period.pug
================================================
span .
================================================
FILE: packages/pug/test/cases/some-included.styl
================================================
body
padding 10px
================================================
FILE: packages/pug/test/cases/some.md
================================================
Just _some_ markdown **tests**.
With new line.
================================================
FILE: packages/pug/test/cases/some.styl
================================================
@import "some-included"
================================================
FILE: packages/pug/test/cases/source.html
================================================
<html>
<audio preload="auto" autobuffer="autobuffer" controls="controls">
<source src="foo"/>
<source src="bar"/>
</audio>
</html>
================================================
FILE: packages/pug/test/cases/source.pug
================================================
html
audio(preload='auto', autobuffer, controls)
source(src='foo')
source(src='bar')
================================================
FILE: packages/pug/test/cases/styles.html
================================================
<html>
<head>
<style>
body {
padding: 50px;
}
</style>
</head>
<body>
<div style="color:red;background:green"></div>
<div style="color:red;background:green;"></div>
<div style="color:red;background:green"></div>
<div style="color:red;background:green;"></div>
<div style="color:red;background:green"></div>
<div style="color:red;background:green;"></div>
<div style="color:red;background:green;"></div>
<div style="color:red;background:green;"></div>
<div style="color:red;background:green;"></div>
</body>
</html>
================================================
FILE: packages/pug/test/cases/styles.pug
================================================
html
head
style.
body {
padding: 50px;
}
body
div(style='color:red;background:green')
div(style={color: 'red', background: 'green'})
div&attributes({style: 'color:red;background:green'})
div&attributes({style: {color: 'red', background: 'green'}})
mixin div()
div&attributes(attributes)
+div(style='color:red;background:green')
+div(style={color: 'red', background: 'green'})
- var bg = 'green';
div(style={color: 'red', background: bg})
div&attributes({style: {color: 'red', background: bg}})
+div(style={color: 'red', background: bg})
================================================
FILE: packages/pug/test/cases/tag.interpolation.html
================================================
<p>value</p>
<p foo="bar">value</p>
<a something="something">here</a>
<ul>
<li><span><img class="icon" src="contact"/>Contact</span>
</li>
<li><a href="/contact"><img class="icon"/>Contact</a>
</li>
</ul>
================================================
FILE: packages/pug/test/cases/tag.interpolation.pug
================================================
- var tag = 'p'
- var foo = 'bar'
#{tag} value
#{tag}(foo='bar') value
#{foo ? 'a' : 'li'}(something) here
mixin item(icon)
li
if attributes.href
a&attributes(attributes)
img.icon(src=icon)
block
else
span&attributes(attributes)
img.icon(src=icon)
block
ul
+item('contact') Contact
+item(href='/contact') Contact
================================================
FILE: packages/pug/test/cases/tags.self-closing.html
================================================
<body>
<foo></foo>
<foo bar="baz"></foo>
<foo/>
<foo bar="baz"/>
<foo>/</foo>
<foo bar="baz">/</foo>
<foo/>
<foo bar="baz"/>
<foo>/</foo>
<foo bar="baz">/</foo><img/><img/>
<foo/>
</body>
================================================
FILE: packages/pug/test/cases/tags.self-closing.pug
================================================
body
foo
foo(bar='baz')
foo/
foo(bar='baz')/
foo /
foo(bar='baz') /
#{'foo'}/
#{'foo'}(bar='baz')/
#{'foo'} /
#{'foo'}(bar='baz') /
//- can have a single space after them
img
//- can have lots of white space after them
img
#{
'foo'
}/
================================================
FILE: packages/pug/test/cases/template.html
================================================
<script type="text/x-template">
<article>
<h2>{{title}}</h2>
<p>{{description}}</p>
</article>
</script>
<script type="text/x-template">
article
h2 {{title}}
p {{description}}
</script>
================================================
FILE: packages/pug/test/cases/template.pug
================================================
script(type='text/x-template')
article
h2 {{title}}
p {{description}}
script(type='text/x-template').
article
h2 {{title}}
p {{description}}
================================================
FILE: packages/pug/test/cases/text-block.html
================================================
<label>Username:
<input type="text" name="user[name]"/>
</label>
<label>Password:
<input type="text" name="user[pass]"/>
</label>
================================================
FILE: packages/pug/test/cases/text-block.pug
================================================
label Username:
input(type='text', name='user[name]')
label Password:
input(type='text', name='user[pass]')
================================================
FILE: packages/pug/test/cases/text.html
================================================
<option value="">-- (selected) --</option>
<p></p>
<p></p>
<p>
foo
bar
baz
</p>
<p>
foo
bar
baz
</p>foo
bar
baz
<pre>foo
bar
baz
.</pre>
<pre>foo
bar
baz
.
</pre>foo
bar
baz
.
================================================
FILE: packages/pug/test/cases/text.pug
================================================
option(value='') -- (selected) --
p
p.
p
| foo
| bar
|
|
| baz
p.
foo
bar
baz
.
.
foo
bar
baz
pre
| foo
| bar
| baz
| .
pre.
foo
bar
baz
.
.
foo
bar
baz
.
================================================
FILE: packages/pug/test/cases/utf8bom.html
================================================
<p>"foo"</p>
================================================
FILE: packages/pug/test/cases/utf8bom.pug
================================================
p "foo"
================================================
FILE: packages/pug/test/cases/vars.html
================================================
<a class="1 2 3" id="bar"></a>
================================================
FILE: packages/pug/test/cases/vars.pug
================================================
- var foo = 'bar'
- var list = [1,2,3]
a(class=list, id=foo)
================================================
FILE: packages/pug/test/cases/while.html
================================================
<ul>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
</ul>
================================================
FILE: packages/pug/test/cases/while.pug
================================================
- var x = 1;
ul
while x < 10
- x++;
li= x
================================================
FILE: packages/pug/test/cases/xml.html
================================================
<?xml version="1.0" encoding="utf-8" ?>
<category term="some term"/>
<link>http://google.com</link>
================================================
FILE: packages/pug/test/cases/xml.pug
================================================
doctype xml
category(term='some term')/
link http://google.com
================================================
FILE: packages/pug/test/cases/yield-before-conditional-head.html
================================================
<head>
<script src="/jquery.js"></script>
</head>
================================================
FILE: packages/pug/test/cases/yield-before-conditional-head.pug
================================================
head
script(src='/jquery.js')
yield
if false
script(src='/jquery.ui.js')
================================================
FILE: packages/pug/test/cases/yield-before-conditional.html
================================================
<html>
<body>
<head>
<script src="/jquery.js"></script>
<script src="/caustic.js"></script>
<script src="/app.js"></script>
</head>
</body>
</html>
================================================
FILE: packages/pug/test/cases/yield-before-conditional.pug
================================================
html
body
include yield-before-conditional-head.pug
script(src='/caustic.js')
script(src='/app.js')
================================================
FILE: packages/pug/test/cases/yield-head.html
================================================
<head>
<script src="/jquery.js"></script>
<script src="/jquery.ui.js"></script>
</head>
================================================
FILE: packages/pug/test/cases/yield-head.pug
================================================
head
script(src='/jquery.js')
yield
script(src='/jquery.ui.js')
================================================
FILE: packages/pug/test/cases/yield-title-head.html
================================================
<head>
<title></title>
<script src="/jquery.js"></script>
<script src="/jquery.ui.js"></script>
</head>
================================================
FILE: packages/pug/test/cases/yield-title-head.pug
================================================
head
title
yield
script(src='/jquery.js')
script(src='/jquery.ui.js')
================================================
FILE: packages/pug/test/cases/yield-title.html
================================================
<html>
<body>
<head>
<title>My Title</title>
<script src="/jquery.js"></script>
<script src="/jquery.ui.js"></script>
</head>
</body>
</html>
================================================
FILE: packages/pug/test/cases/yield-title.pug
================================================
html
body
include yield-title-head.pug
| My Title
================================================
FILE: packages/pug/test/cases/yield.html
================================================
<html>
<body>
<head>
<script src="/jquery.js"></script>
<script src="/caustic.js"></script>
<script src="/app.js"></script>
<script src="/jquery.ui.js"></script>
</head>
</body>
</html>
================================================
FILE: packages/pug/test/cases/yield.pug
================================================
html
body
include yield-head.pug
script(src='/caustic.js')
script(src='/app.js')
================================================
FILE: packages/pug/test/cases-es2015/attr.html
================================================
<div class="avatar-div" style="background-image: url(https://www.gravatar.com/avatar/219b77f9d21de75e81851b6b886057c7)"></div>
================================================
FILE: packages/pug/test/cases-es2015/attr.pug
================================================
- var avatar = '219b77f9d21de75e81851b6b886057c7'
div.avatar-div(style=`background-image: url(https://www.gravatar.com/avatar/${avatar})`)
================================================
FILE: packages/pug/test/dependencies/dependency1.pug
================================================
strong dependency1
================================================
FILE: packages/pug/test/dependencies/dependency2.pug
================================================
include dependency3.pug
================================================
FILE: packages/pug/test/dependencies/dependency3.pug
================================================
strong dependency3
================================================
FILE: packages/pug/test/dependencies/extends1.pug
================================================
extends dependency1.pug
================================================
FILE: packages/pug/test/dependencies/extends2.pug
================================================
extends dependency2.pug
================================================
FILE: packages/pug/test/dependencies/include1.pug
================================================
include dependency1.pug
================================================
FILE: packages/pug/test/dependencies/include2.pug
================================================
include dependency2.pug
================================================
FILE: packages/pug/test/duplicate-block/__snapshots__/index.test.js.snap
================================================
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`layout with duplicate block 1`] = `"<div>Hello World</div>"`;
exports[`layout with duplicate block 2`] = `"<!DOCTYPE html><html><head></head><body><div>Hello World</div></body></html>"`;
================================================
FILE: packages/pug/test/duplicate-block/index.pug
================================================
extends ./layout-with-duplicate-block.pug
block content
div Hello World
================================================
FILE: packages/pug/test/duplicate-block/index.test.js
================================================
const pug = require('../../');
test('layout with duplicate block', () => {
const outputWithAjax = pug.renderFile(__dirname + '/index.pug', {ajax: true});
const outputWithoutAjax = pug.renderFile(__dirname + '/index.pug', {
ajax: false,
});
expect(outputWithAjax).toMatchSnapshot();
expect(outputWithoutAjax).toMatchSnapshot();
});
================================================
FILE: packages/pug/test/duplicate-block/layout-with-duplicate-block.pug
================================================
if ajax
block content
else
doctype html
html
head
body
block content
================================================
FILE: packages/pug/test/eachOf/__snapshots__/index.test.js.snap
================================================
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Proper Usage Brackets 1`] = `"<li>a</li><li>b</li><li>foo</li><li>bar</li>"`;
exports[`Proper Usage No Brackets 1`] = `"<li>a</li><li>b</li><li>foo</li><li>bar</li>"`;
================================================
FILE: packages/pug/test/eachOf/error/left-side.pug
================================================
each [key, val of users
li= key
li= val
================================================
FILE: packages/pug/test/eachOf/error/no-brackets.pug
================================================
each key, val of users
li= key
li= val
================================================
FILE: packages/pug/test/eachOf/error/one-val.pug
================================================
each [key] of users
li= key
li= val
================================================
FILE: packages/pug/test/eachOf/error/right-side.pug
================================================
each key, val] of users
li= key
li= val
================================================
FILE: packages/pug/test/eachOf/index.test.js
================================================
const pug = require('../../');
describe('Inproper Usage', () => {
test('Only left-side bracket', () => {
expect(() => pug.compileFile(__dirname + '/error/left-side.pug')).toThrow(
'The value variable for each must either be a valid identifier (e.g. `item`) or a pair of identifiers in square brackets (e.g. `[key, value]`).'
);
});
test('Only right-side bracket', () => {
expect(() => pug.compileFile(__dirname + '/error/right-side.pug')).toThrow(
'The value variable for each must either be a valid identifier (e.g. `item`) or a pair of identifiers in square brackets (e.g. `[key, value]`).'
);
});
test('Only one value inside brackets', () => {
expect(() => pug.compileFile(__dirname + '/error/one-val.pug')).toThrow(
'The value variable for each must either be a valid identifier (e.g. `item`) or a pair of identifiers in square brackets (e.g. `[key, value]`).'
);
});
test('No brackets', () => {
expect(() => pug.compileFile(__dirname + '/error/no-brackets.pug')).toThrow(
'The value variable for each must either be a valid identifier (e.g. `item`) or a pair of identifiers in square brackets (e.g. `[key, value]`).'
);
});
});
describe('Proper Usage', () => {
test('Brackets', () => {
const html = pug.renderFile(__dirname + '/passing/brackets.pug', {
users: new Map([
['a', 'b'],
['foo', 'bar'],
]),
});
expect(html).toMatchSnapshot();
});
test('No Brackets', () => {
const html = pug.renderFile(__dirname + '/passing/no-brackets.pug', {
users: new Map([
['a', 'b'],
['foo', 'bar'],
]),
});
expect(html).toMatchSnapshot();
});
});
================================================
FILE: packages/pug/test/eachOf/passing/brackets.pug
================================================
each [key, val] of users
li= key
li= val
================================================
FILE: packages/pug/test/eachOf/passing/no-brackets.pug
================================================
each data of users
li= data[0]
li= data[1]
================================================
FILE: packages/pug/test/error.reporting.test.js
================================================
/**
* Module dependencies.
*/
var pug = require('../');
var assert = require('assert');
var fs = require('fs');
// Shortcut
function getError(str, options) {
try {
pug.render(str, options);
} catch (ex) {
return ex;
}
throw new Error('Input was supposed to result in an error.');
}
function getFileError(name, options) {
try {
pug.renderFile(name, options);
} catch (ex) {
return ex;
}
throw new Error('Input was supposed to result in an error.');
}
describe('error reporting', function() {
describe('compile time errors', function() {
describe('with no filename', function() {
it('includes detail of where the error was thrown', function() {
var err = getError('foo(');
expect(err.message).toMatch(/Pug:1/);
expect(err.message).toMatch(/foo\(/);
});
});
describe('with a filename', function() {
it('includes detail of where the error was thrown including the filename', function() {
var err = getError('foo(', {filename: 'test.pug'});
expect(err.message).toMatch(/test\.pug:1/);
expect(err.message).toMatch(/foo\(/);
});
});
describe('with a layout without block declaration (syntax)', function() {
it('includes detail of where the error was thrown including the filename', function() {
var err = getFileError(
__dirname + '/fixtures/compile.with.layout.syntax.error.pug',
{}
);
expect(err.message).toMatch(/[\\\/]layout.syntax.error.pug:2/);
expect(err.message).toMatch(/foo\(/);
});
});
describe('with a layout without block declaration (locals)', function() {
it('includes detail of where the error was thrown including the filename', function() {
var err = getFileError(
__dirname + '/fixtures/compile.with.layout.locals.error.pug',
{}
);
expect(err.message).toMatch(/[\\\/]layout.locals.error.pug:2/);
expect(err.message).toMatch(/is not a function/);
});
});
describe('with a include (syntax)', function() {
it('includes detail of where the error was thrown including the filename', function() {
var err = getFileError(
__dirname + '/fixtures/compile.with.include.syntax.error.pug',
{}
);
expect(err.message).toMatch(/[\\\/]include.syntax.error.pug:2/);
expect(err.message).toMatch(/foo\(/);
});
});
describe('with a include (locals)', function() {
it('includes detail of where the error was thrown including the filename', function() {
var err = getFileError(
__dirname + '/fixtures/compile.with.include.locals.error.pug',
{}
);
expect(err.message).toMatch(/[\\\/]include.locals.error.pug:2/);
expect(err.message).toMatch(/foo\(/);
});
it('handles compileDebug option properly', function() {
var err = getFileError(
__dirname + '/fixtures/compile.with.include.locals.error.pug',
{
compileDebug: true,
}
);
expect(err.message).toMatch(/[\\\/]include.locals.error.pug:2/);
expect(err.message).toMatch(/foo is not a function/);
});
});
describe('with a layout (without block) with an include (syntax)', function() {
it('includes detail of where the error was thrown including the filename', function() {
var err = getFileError(
__dirname +
'/fixtures/compile.with.layout.with.include.syntax.error.pug',
{}
);
expect(err.message).toMatch(/[\\\/]include.syntax.error.pug:2/);
expect(err.message).toMatch(/foo\(/);
});
});
describe('with a layout (without block) with an include (locals)', function() {
it('includes detail of where the error was thrown including the filename', function() {
var err = getFileError(
__dirname +
'/fixtures/compile.with.layout.with.include.locals.error.pug',
{}
);
expect(err.message).toMatch(/[\\\/]include.locals.error.pug:2/);
expect(err.message).toMatch(/foo\(/);
});
gitextract_f46w__89/ ├── .editorconfig ├── .gitattributes ├── .github/ │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE.md │ └── workflows/ │ ├── rollingversions.yml │ └── test.yml ├── .gitignore ├── .prettierrc.js ├── README.md ├── SECURITY.md ├── package.json ├── packages/ │ ├── pug/ │ │ ├── History.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── examples/ │ │ │ ├── README.md │ │ │ ├── attributes.js │ │ │ ├── attributes.pug │ │ │ ├── code.js │ │ │ ├── code.pug │ │ │ ├── dynamicscript.js │ │ │ ├── dynamicscript.pug │ │ │ ├── each.js │ │ │ ├── each.pug │ │ │ ├── extend-layout.pug │ │ │ ├── extend.js │ │ │ ├── extend.pug │ │ │ ├── form.js │ │ │ ├── form.pug │ │ │ ├── includes/ │ │ │ │ ├── foot.pug │ │ │ │ ├── head.pug │ │ │ │ ├── scripts.pug │ │ │ │ └── style.css │ │ │ ├── includes.js │ │ │ ├── includes.pug │ │ │ ├── layout-debug.js │ │ │ ├── layout.js │ │ │ ├── layout.pug │ │ │ ├── mixins/ │ │ │ │ ├── dialog.pug │ │ │ │ └── profile.pug │ │ │ ├── mixins.js │ │ │ ├── mixins.pug │ │ │ ├── pet.pug │ │ │ ├── rss.js │ │ │ ├── rss.pug │ │ │ ├── text.js │ │ │ ├── text.pug │ │ │ ├── whitespace.js │ │ │ └── whitespace.pug │ │ ├── lib/ │ │ │ └── index.js │ │ ├── package.json │ │ ├── register.js │ │ ├── support/ │ │ │ └── benchmark.js │ │ └── test/ │ │ ├── README.md │ │ ├── __snapshots__/ │ │ │ └── pug.test.js.snap │ │ ├── anti-cases/ │ │ │ ├── attrs.unescaped.pug │ │ │ ├── case-when.pug │ │ │ ├── case-without-with.pug │ │ │ ├── else-condition.pug │ │ │ ├── else-without-if.pug │ │ │ ├── inlining-a-mixin-after-a-tag.pug │ │ │ ├── key-char-ending-badly.pug │ │ │ ├── key-ending-badly.pug │ │ │ ├── mismatched-inline-tag.pug │ │ │ ├── mixin-args-syntax-error.pug │ │ │ ├── mixins-blocks-with-bodies.pug │ │ │ ├── multiple-non-nested-tags-on-a-line.pug │ │ │ ├── non-existant-filter.pug │ │ │ ├── non-mixin-block.pug │ │ │ ├── open-brace-in-attributes.pug │ │ │ ├── readme.md │ │ │ ├── self-closing-tag-with-block.pug │ │ │ ├── self-closing-tag-with-body.pug │ │ │ ├── self-closing-tag-with-code.pug │ │ │ ├── tabs-and-spaces.pug │ │ │ ├── unclosed-interpolated-call.pug │ │ │ ├── unclosed-interpolated-tag.pug │ │ │ └── unclosed-interpolation.pug │ │ ├── browser/ │ │ │ ├── index.html │ │ │ └── index.pug │ │ ├── cases/ │ │ │ ├── attrs-data.html │ │ │ ├── attrs-data.pug │ │ │ ├── attrs.colon.html │ │ │ ├── attrs.colon.pug │ │ │ ├── attrs.html │ │ │ ├── attrs.js.html │ │ │ ├── attrs.js.pug │ │ │ ├── attrs.pug │ │ │ ├── attrs.unescaped.html │ │ │ ├── attrs.unescaped.pug │ │ │ ├── auxiliary/ │ │ │ │ ├── 1794-extends.pug │ │ │ │ ├── 1794-include.pug │ │ │ │ ├── blocks-in-blocks-layout.pug │ │ │ │ ├── dialog.pug │ │ │ │ ├── empty-block.pug │ │ │ │ ├── escapes.html │ │ │ │ ├── extends-empty-block-1.pug │ │ │ │ ├── extends-empty-block-2.pug │ │ │ │ ├── extends-from-root.pug │ │ │ │ ├── extends-relative.pug │ │ │ │ ├── filter-in-include.pug │ │ │ │ ├── includable.js │ │ │ │ ├── include-from-root.pug │ │ │ │ ├── inheritance.extend.mixin.block.pug │ │ │ │ ├── inheritance.extend.recursive-grand-grandparent.pug │ │ │ │ ├── inheritance.extend.recursive-grandparent.pug │ │ │ │ ├── inheritance.extend.recursive-parent.pug │ │ │ │ ├── layout.include.pug │ │ │ │ ├── layout.pug │ │ │ │ ├── mixin-at-end-of-file.pug │ │ │ │ ├── mixins.pug │ │ │ │ ├── pet.pug │ │ │ │ ├── smile.html │ │ │ │ ├── window.pug │ │ │ │ └── yield-nested.pug │ │ │ ├── basic.html │ │ │ ├── basic.pug │ │ │ ├── blanks.html │ │ │ ├── blanks.pug │ │ │ ├── block-code.html │ │ │ ├── block-code.pug │ │ │ ├── block-expansion.html │ │ │ ├── block-expansion.pug │ │ │ ├── block-expansion.shorthands.html │ │ │ ├── block-expansion.shorthands.pug │ │ │ ├── blockquote.html │ │ │ ├── blockquote.pug │ │ │ ├── blocks-in-blocks.html │ │ │ ├── blocks-in-blocks.pug │ │ │ ├── blocks-in-if.html │ │ │ ├── blocks-in-if.pug │ │ │ ├── case-blocks.html │ │ │ ├── case-blocks.pug │ │ │ ├── case.html │ │ │ ├── case.pug │ │ │ ├── classes-empty.html │ │ │ ├── classes-empty.pug │ │ │ ├── classes.html │ │ │ ├── classes.pug │ │ │ ├── code.conditionals.html │ │ │ ├── code.conditionals.pug │ │ │ ├── code.escape.html │ │ │ ├── code.escape.pug │ │ │ ├── code.html │ │ │ ├── code.iteration.html │ │ │ ├── code.iteration.pug │ │ │ ├── code.pug │ │ │ ├── comments-in-case.html │ │ │ ├── comments-in-case.pug │ │ │ ├── comments.html │ │ │ ├── comments.pug │ │ │ ├── comments.source.html │ │ │ ├── comments.source.pug │ │ │ ├── doctype.custom.html │ │ │ ├── doctype.custom.pug │ │ │ ├── doctype.default.html │ │ │ ├── doctype.default.pug │ │ │ ├── doctype.keyword.html │ │ │ ├── doctype.keyword.pug │ │ │ ├── each.else.html │ │ │ ├── each.else.pug │ │ │ ├── escape-chars.html │ │ │ ├── escape-chars.pug │ │ │ ├── escape-test.html │ │ │ ├── escape-test.pug │ │ │ ├── escaping-class-attribute.html │ │ │ ├── escaping-class-attribute.pug │ │ │ ├── filter-in-include.html │ │ │ ├── filter-in-include.pug │ │ │ ├── filters-empty.html │ │ │ ├── filters-empty.pug │ │ │ ├── filters.coffeescript.html │ │ │ ├── filters.coffeescript.pug │ │ │ ├── filters.custom.html │ │ │ ├── filters.custom.pug │ │ │ ├── filters.include.custom.html │ │ │ ├── filters.include.custom.pug │ │ │ ├── filters.include.html │ │ │ ├── filters.include.pug │ │ │ ├── filters.inline.html │ │ │ ├── filters.inline.pug │ │ │ ├── filters.less.html │ │ │ ├── filters.less.pug │ │ │ ├── filters.markdown.html │ │ │ ├── filters.markdown.pug │ │ │ ├── filters.nested.html │ │ │ ├── filters.nested.pug │ │ │ ├── filters.stylus.html │ │ │ ├── filters.stylus.pug │ │ │ ├── html.html │ │ │ ├── html.pug │ │ │ ├── html5.html │ │ │ ├── html5.pug │ │ │ ├── include-extends-from-root.html │ │ │ ├── include-extends-from-root.pug │ │ │ ├── include-extends-of-common-template.html │ │ │ ├── include-extends-of-common-template.pug │ │ │ ├── include-extends-relative.html │ │ │ ├── include-extends-relative.pug │ │ │ ├── include-filter-coffee.coffee │ │ │ ├── include-only-text-body.html │ │ │ ├── include-only-text-body.pug │ │ │ ├── include-only-text.html │ │ │ ├── include-only-text.pug │ │ │ ├── include-with-text-head.html │ │ │ ├── include-with-text-head.pug │ │ │ ├── include-with-text.html │ │ │ ├── include-with-text.pug │ │ │ ├── include.script.html │ │ │ ├── include.script.pug │ │ │ ├── include.yield.nested.html │ │ │ ├── include.yield.nested.pug │ │ │ ├── includes-with-ext-js.html │ │ │ ├── includes-with-ext-js.pug │ │ │ ├── includes.html │ │ │ ├── includes.pug │ │ │ ├── inheritance.alert-dialog.html │ │ │ ├── inheritance.alert-dialog.pug │ │ │ ├── inheritance.defaults.html │ │ │ ├── inheritance.defaults.pug │ │ │ ├── inheritance.extend.html │ │ │ ├── inheritance.extend.include.html │ │ │ ├── inheritance.extend.include.pug │ │ │ ├── inheritance.extend.mixins.block.html │ │ │ ├── inheritance.extend.mixins.block.pug │ │ │ ├── inheritance.extend.mixins.html │ │ │ ├── inheritance.extend.mixins.pug │ │ │ ├── inheritance.extend.pug │ │ │ ├── inheritance.extend.recursive.html │ │ │ ├── inheritance.extend.recursive.pug │ │ │ ├── inheritance.extend.whitespace.html │ │ │ ├── inheritance.extend.whitespace.pug │ │ │ ├── inheritance.html │ │ │ ├── inheritance.pug │ │ │ ├── inline-tag.html │ │ │ ├── inline-tag.pug │ │ │ ├── intepolated-elements.html │ │ │ ├── intepolated-elements.pug │ │ │ ├── interpolated-mixin.html │ │ │ ├── interpolated-mixin.pug │ │ │ ├── interpolation.escape.html │ │ │ ├── interpolation.escape.pug │ │ │ ├── javascript-new-lines.js │ │ │ ├── layout.append.html │ │ │ ├── layout.append.pug │ │ │ ├── layout.append.without-block.html │ │ │ ├── layout.append.without-block.pug │ │ │ ├── layout.multi.append.prepend.block.html │ │ │ ├── layout.multi.append.prepend.block.pug │ │ │ ├── layout.prepend.html │ │ │ ├── layout.prepend.pug │ │ │ ├── layout.prepend.without-block.html │ │ │ ├── layout.prepend.without-block.pug │ │ │ ├── mixin-at-end-of-file.html │ │ │ ├── mixin-at-end-of-file.pug │ │ │ ├── mixin-block-with-space.html │ │ │ ├── mixin-block-with-space.pug │ │ │ ├── mixin-hoist.html │ │ │ ├── mixin-hoist.pug │ │ │ ├── mixin-via-include.html │ │ │ ├── mixin-via-include.pug │ │ │ ├── mixin.attrs.html │ │ │ ├── mixin.attrs.pug │ │ │ ├── mixin.block-tag-behaviour.html │ │ │ ├── mixin.block-tag-behaviour.pug │ │ │ ├── mixin.blocks.html │ │ │ ├── mixin.blocks.pug │ │ │ ├── mixin.merge.html │ │ │ ├── mixin.merge.pug │ │ │ ├── mixins-unused.html │ │ │ ├── mixins-unused.pug │ │ │ ├── mixins.html │ │ │ ├── mixins.pug │ │ │ ├── mixins.rest-args.html │ │ │ ├── mixins.rest-args.pug │ │ │ ├── namespaces.html │ │ │ ├── namespaces.pug │ │ │ ├── nesting.html │ │ │ ├── nesting.pug │ │ │ ├── pipeless-comments.html │ │ │ ├── pipeless-comments.pug │ │ │ ├── pipeless-filters.html │ │ │ ├── pipeless-filters.pug │ │ │ ├── pipeless-tag.html │ │ │ ├── pipeless-tag.pug │ │ │ ├── pre.html │ │ │ ├── pre.pug │ │ │ ├── quotes.html │ │ │ ├── quotes.pug │ │ │ ├── regression.1794.html │ │ │ ├── regression.1794.pug │ │ │ ├── regression.784.html │ │ │ ├── regression.784.pug │ │ │ ├── script.whitespace.html │ │ │ ├── script.whitespace.pug │ │ │ ├── scripts.html │ │ │ ├── scripts.non-js.html │ │ │ ├── scripts.non-js.pug │ │ │ ├── scripts.pug │ │ │ ├── self-closing-html.html │ │ │ ├── self-closing-html.pug │ │ │ ├── single-period.html │ │ │ ├── single-period.pug │ │ │ ├── some-included.styl │ │ │ ├── some.md │ │ │ ├── some.styl │ │ │ ├── source.html │ │ │ ├── source.pug │ │ │ ├── styles.html │ │ │ ├── styles.pug │ │ │ ├── tag.interpolation.html │ │ │ ├── tag.interpolation.pug │ │ │ ├── tags.self-closing.html │ │ │ ├── tags.self-closing.pug │ │ │ ├── template.html │ │ │ ├── template.pug │ │ │ ├── text-block.html │ │ │ ├── text-block.pug │ │ │ ├── text.html │ │ │ ├── text.pug │ │ │ ├── utf8bom.html │ │ │ ├── utf8bom.pug │ │ │ ├── vars.html │ │ │ ├── vars.pug │ │ │ ├── while.html │ │ │ ├── while.pug │ │ │ ├── xml.html │ │ │ ├── xml.pug │ │ │ ├── yield-before-conditional-head.html │ │ │ ├── yield-before-conditional-head.pug │ │ │ ├── yield-before-conditional.html │ │ │ ├── yield-before-conditional.pug │ │ │ ├── yield-head.html │ │ │ ├── yield-head.pug │ │ │ ├── yield-title-head.html │ │ │ ├── yield-title-head.pug │ │ │ ├── yield-title.html │ │ │ ├── yield-title.pug │ │ │ ├── yield.html │ │ │ └── yield.pug │ │ ├── cases-es2015/ │ │ │ ├── attr.html │ │ │ └── attr.pug │ │ ├── dependencies/ │ │ │ ├── dependency1.pug │ │ │ ├── dependency2.pug │ │ │ ├── dependency3.pug │ │ │ ├── extends1.pug │ │ │ ├── extends2.pug │ │ │ ├── include1.pug │ │ │ └── include2.pug │ │ ├── duplicate-block/ │ │ │ ├── __snapshots__/ │ │ │ │ └── index.test.js.snap │ │ │ ├── index.pug │ │ │ ├── index.test.js │ │ │ └── layout-with-duplicate-block.pug │ │ ├── eachOf/ │ │ │ ├── __snapshots__/ │ │ │ │ └── index.test.js.snap │ │ │ ├── error/ │ │ │ │ ├── left-side.pug │ │ │ │ ├── no-brackets.pug │ │ │ │ ├── one-val.pug │ │ │ │ └── right-side.pug │ │ │ ├── index.test.js │ │ │ └── passing/ │ │ │ ├── brackets.pug │ │ │ └── no-brackets.pug │ │ ├── error.reporting.test.js │ │ ├── examples.test.js │ │ ├── extends-not-top-level/ │ │ │ ├── default.pug │ │ │ ├── duplicate.pug │ │ │ ├── index.pug │ │ │ └── index.test.js │ │ ├── fixtures/ │ │ │ ├── append/ │ │ │ │ ├── app-layout.pug │ │ │ │ ├── layout.pug │ │ │ │ ├── page.html │ │ │ │ └── page.pug │ │ │ ├── append-without-block/ │ │ │ │ ├── app-layout.pug │ │ │ │ ├── layout.pug │ │ │ │ └── page.pug │ │ │ ├── compile.with.include.locals.error.pug │ │ │ ├── compile.with.include.syntax.error.pug │ │ │ ├── compile.with.layout.locals.error.pug │ │ │ ├── compile.with.layout.syntax.error.pug │ │ │ ├── compile.with.layout.with.include.locals.error.pug │ │ │ ├── compile.with.layout.with.include.syntax.error.pug │ │ │ ├── element-with-multiple-attributes.pug │ │ │ ├── include.locals.error.pug │ │ │ ├── include.syntax.error.pug │ │ │ ├── invalid-block-in-extends.pug │ │ │ ├── issue-1593/ │ │ │ │ ├── include-layout.pug │ │ │ │ ├── include.pug │ │ │ │ ├── index.pug │ │ │ │ └── layout.pug │ │ │ ├── layout.locals.error.pug │ │ │ ├── layout.pug │ │ │ ├── layout.syntax.error.pug │ │ │ ├── layout.with.runtime.error.pug │ │ │ ├── mixin-include.pug │ │ │ ├── mixin.error.pug │ │ │ ├── multi-append-prepend-block/ │ │ │ │ ├── redefine.pug │ │ │ │ └── root.pug │ │ │ ├── perf.pug │ │ │ ├── prepend/ │ │ │ │ ├── app-layout.pug │ │ │ │ ├── layout.pug │ │ │ │ ├── page.html │ │ │ │ └── page.pug │ │ │ ├── prepend-without-block/ │ │ │ │ ├── app-layout.pug │ │ │ │ ├── layout.pug │ │ │ │ ├── page.html │ │ │ │ └── page.pug │ │ │ ├── runtime.error.pug │ │ │ ├── runtime.layout.error.pug │ │ │ ├── runtime.with.mixin.error.pug │ │ │ └── scripts.pug │ │ ├── markdown-it/ │ │ │ ├── comment.md │ │ │ ├── index.test.js │ │ │ ├── layout-markdown-include.pug │ │ │ └── layout-markdown-inline.pug │ │ ├── plugins.test.js │ │ ├── pug.test.js │ │ ├── regression-2436/ │ │ │ ├── __snapshots__/ │ │ │ │ └── index.test.js.snap │ │ │ ├── index.test.js │ │ │ ├── issue1.pug │ │ │ ├── issue2.pug │ │ │ ├── layout.pug │ │ │ ├── other1.pug │ │ │ ├── other2.pug │ │ │ └── other_layout.pug │ │ ├── run-es2015.test.js │ │ ├── run-syntax-errors.test.js │ │ ├── run-utils.js │ │ ├── run.test.js │ │ └── shadowed-block/ │ │ ├── __snapshots__/ │ │ │ └── index.test.js.snap │ │ ├── base.pug │ │ ├── index.pug │ │ ├── index.test.js │ │ └── layout.pug │ ├── pug-attrs/ │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.js │ │ ├── package.json │ │ └── test/ │ │ └── index.test.js │ ├── pug-code-gen/ │ │ ├── HISTORY.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.js │ │ └── package.json │ ├── pug-error/ │ │ ├── LICENSE │ │ ├── README.md │ │ ├── package.json │ │ ├── src/ │ │ │ └── index.ts │ │ ├── test/ │ │ │ └── index.test.js │ │ └── tsconfig.json │ ├── pug-filters/ │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.js │ │ ├── lib/ │ │ │ ├── handle-filters.js │ │ │ └── run-filter.js │ │ ├── package.json │ │ └── test/ │ │ ├── __snapshots__/ │ │ │ ├── filter-aliases.test.js.snap │ │ │ ├── index.test.js.snap │ │ │ └── per-filter-options-applied-to-nested-filters.test.js.snap │ │ ├── cases/ │ │ │ ├── filters-empty.input.json │ │ │ ├── filters.cdata.input.json │ │ │ ├── filters.coffeescript.input.json │ │ │ ├── filters.custom.input.json │ │ │ ├── filters.include.custom.input.json │ │ │ ├── filters.include.custom.pug │ │ │ ├── filters.include.input.json │ │ │ ├── filters.inline.input.json │ │ │ ├── filters.less.input.json │ │ │ ├── filters.markdown.input.json │ │ │ ├── filters.nested.input.json │ │ │ ├── filters.stylus.input.json │ │ │ ├── include-filter-coffee.coffee │ │ │ └── some.md │ │ ├── custom-filters.js │ │ ├── errors/ │ │ │ └── dynamic-option.input.json │ │ ├── errors-src/ │ │ │ └── dynamic-option.jade │ │ ├── filter-aliases.test.js │ │ ├── index.test.js │ │ └── per-filter-options-applied-to-nested-filters.test.js │ ├── pug-lexer/ │ │ ├── History.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── package.json │ │ └── test/ │ │ ├── __snapshots__/ │ │ │ └── index.test.js.snap │ │ ├── cases/ │ │ │ ├── attr-es2015.pug │ │ │ ├── attrs-data.pug │ │ │ ├── attrs.js.pug │ │ │ ├── attrs.pug │ │ │ ├── attrs.unescaped.pug │ │ │ ├── basic.pug │ │ │ ├── blanks.pug │ │ │ ├── block-code.pug │ │ │ ├── block-expansion.pug │ │ │ ├── block-expansion.shorthands.pug │ │ │ ├── blockquote.pug │ │ │ ├── blocks-in-blocks.pug │ │ │ ├── blocks-in-if.pug │ │ │ ├── case-blocks.pug │ │ │ ├── case.pug │ │ │ ├── classes-empty.pug │ │ │ ├── classes.pug │ │ │ ├── code.conditionals.pug │ │ │ ├── code.escape.pug │ │ │ ├── code.iteration.pug │ │ │ ├── code.pug │ │ │ ├── comments-in-case.pug │ │ │ ├── comments.pug │ │ │ ├── comments.source.pug │ │ │ ├── doctype.custom.pug │ │ │ ├── doctype.default.pug │ │ │ ├── doctype.keyword.pug │ │ │ ├── each.else.pug │ │ │ ├── escape-chars.pug │ │ │ ├── escape-test.pug │ │ │ ├── escaping-class-attribute.pug │ │ │ ├── filter-in-include.pug │ │ │ ├── filters-empty.pug │ │ │ ├── filters.coffeescript.pug │ │ │ ├── filters.custom.pug │ │ │ ├── filters.include.custom.pug │ │ │ ├── filters.include.pug │ │ │ ├── filters.inline.pug │ │ │ ├── filters.less.pug │ │ │ ├── filters.markdown.pug │ │ │ ├── filters.nested.pug │ │ │ ├── filters.stylus.pug │ │ │ ├── filters.verbatim.pug │ │ │ ├── html.pug │ │ │ ├── html5.pug │ │ │ ├── include-extends-from-root.pug │ │ │ ├── include-extends-of-common-template.pug │ │ │ ├── include-extends-relative.pug │ │ │ ├── include-only-text-body.pug │ │ │ ├── include-only-text.pug │ │ │ ├── include-with-text-head.pug │ │ │ ├── include-with-text.pug │ │ │ ├── include.script.pug │ │ │ ├── include.yield.nested.pug │ │ │ ├── includes-with-ext-js.pug │ │ │ ├── includes.pug │ │ │ ├── inheritance.alert-dialog.pug │ │ │ ├── inheritance.defaults.pug │ │ │ ├── inheritance.extend.include.pug │ │ │ ├── inheritance.extend.mixins.block.pug │ │ │ ├── inheritance.extend.mixins.pug │ │ │ ├── inheritance.extend.pug │ │ │ ├── inheritance.extend.recursive.pug │ │ │ ├── inheritance.extend.whitespace.pug │ │ │ ├── inheritance.pug │ │ │ ├── inline-block-comment.pug │ │ │ ├── inline-tag.pug │ │ │ ├── intepolated-elements.pug │ │ │ ├── interpolated-mixin.pug │ │ │ ├── interpolation.escape.pug │ │ │ ├── javascript-new-lines.js │ │ │ ├── layout.append.pug │ │ │ ├── layout.append.without-block.pug │ │ │ ├── layout.multi.append.prepend.block.pug │ │ │ ├── layout.prepend.pug │ │ │ ├── layout.prepend.without-block.pug │ │ │ ├── mixin-at-end-of-file.pug │ │ │ ├── mixin-block-with-space.pug │ │ │ ├── mixin-hoist.pug │ │ │ ├── mixin-via-include.pug │ │ │ ├── mixin.attrs.pug │ │ │ ├── mixin.block-tag-behaviour.pug │ │ │ ├── mixin.blocks.pug │ │ │ ├── mixin.merge.pug │ │ │ ├── mixins-unused.pug │ │ │ ├── mixins.pug │ │ │ ├── mixins.rest-args.pug │ │ │ ├── namespaces.pug │ │ │ ├── nesting.pug │ │ │ ├── pipeless-comments.pug │ │ │ ├── pipeless-filters.pug │ │ │ ├── pipeless-tag.pug │ │ │ ├── pre.pug │ │ │ ├── quotes.pug │ │ │ ├── regression.1794.pug │ │ │ ├── regression.784.pug │ │ │ ├── script.whitespace.pug │ │ │ ├── scripts.non-js.pug │ │ │ ├── scripts.pug │ │ │ ├── self-closing-html.pug │ │ │ ├── single-period.pug │ │ │ ├── source.pug │ │ │ ├── styles.pug │ │ │ ├── tag-blocks.pug │ │ │ ├── tag.interpolation.pug │ │ │ ├── tags.self-closing.pug │ │ │ ├── template.pug │ │ │ ├── text-block.pug │ │ │ ├── text.pug │ │ │ ├── utf8bom.pug │ │ │ ├── vars.pug │ │ │ ├── while.pug │ │ │ ├── xml.pug │ │ │ ├── yield-before-conditional-head.pug │ │ │ ├── yield-before-conditional.pug │ │ │ ├── yield-head.pug │ │ │ ├── yield-title-head.pug │ │ │ ├── yield-title.pug │ │ │ └── yield.pug │ │ ├── check-lexer-functions.test.js │ │ ├── errors/ │ │ │ ├── attribute-invalid-expression.pug │ │ │ ├── case-with-invalid-expression.pug │ │ │ ├── case-with-no-expression.pug │ │ │ ├── default-with-expression.pug │ │ │ ├── else-with-condition.pug │ │ │ ├── extends-no-path.pug │ │ │ ├── include-filter-no-path-2.pug │ │ │ ├── include-filter-no-path.pug │ │ │ ├── include-filter-no-space.pug │ │ │ ├── include-no-path.pug │ │ │ ├── inconsistent-indentation.pug │ │ │ ├── interpolated-call.pug │ │ │ ├── invalid-class-name-1.pug │ │ │ ├── invalid-class-name-2.pug │ │ │ ├── invalid-class-name-3.pug │ │ │ ├── invalid-id.pug │ │ │ ├── malformed-each.pug │ │ │ ├── malformed-extend.pug │ │ │ ├── malformed-include.pug │ │ │ ├── mismatched-inline-tag.pug │ │ │ ├── mismatched-tag-interpolation.pug │ │ │ ├── multi-line-interpolation.pug │ │ │ ├── old-prefixed-each.pug │ │ │ ├── open-interpolation.pug │ │ │ ├── when-with-no-expression.pug │ │ │ └── while-with-no-expression.pug │ │ └── index.test.js │ ├── pug-linker/ │ │ ├── HISTORY.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.js │ │ ├── package.json │ │ └── test/ │ │ ├── __snapshots__/ │ │ │ └── index.test.js.snap │ │ ├── cases/ │ │ │ ├── include-extends-from-root.input.json │ │ │ ├── include-extends-of-common-template.input.json │ │ │ ├── include-extends-relative.input.json │ │ │ ├── include-filter-stylus.input.json │ │ │ ├── include-filter.input.json │ │ │ ├── include-only-text-body.input.json │ │ │ ├── include-only-text.input.json │ │ │ ├── include-with-text-head.input.json │ │ │ ├── include-with-text.input.json │ │ │ ├── include.script.input.json │ │ │ ├── include.yield.nested.input.json │ │ │ ├── includes-with-ext-js.input.json │ │ │ ├── includes.input.json │ │ │ ├── layout.append.input.json │ │ │ ├── layout.append.without-block.input.json │ │ │ ├── layout.multi.append.prepend.block.input.json │ │ │ ├── layout.prepend.input.json │ │ │ └── layout.prepend.without-block.input.json │ │ ├── cases-src/ │ │ │ ├── auxiliary/ │ │ │ │ ├── 1794-extends.pug │ │ │ │ ├── 1794-include.pug │ │ │ │ ├── blocks-in-blocks-layout.pug │ │ │ │ ├── dialog.pug │ │ │ │ ├── empty-block.pug │ │ │ │ ├── escapes.html │ │ │ │ ├── extends-empty-block-1.pug │ │ │ │ ├── extends-empty-block-2.pug │ │ │ │ ├── extends-from-root.pug │ │ │ │ ├── extends-relative.pug │ │ │ │ ├── filter-in-include.pug │ │ │ │ ├── includable.js │ │ │ │ ├── include-from-root.pug │ │ │ │ ├── inheritance.extend.mixin.block.pug │ │ │ │ ├── inheritance.extend.recursive-grand-grandparent.pug │ │ │ │ ├── inheritance.extend.recursive-grandparent.pug │ │ │ │ ├── inheritance.extend.recursive-parent.pug │ │ │ │ ├── layout.include.pug │ │ │ │ ├── layout.pug │ │ │ │ ├── mixin-at-end-of-file.pug │ │ │ │ ├── mixins.pug │ │ │ │ ├── pet.pug │ │ │ │ ├── smile.html │ │ │ │ ├── window.pug │ │ │ │ └── yield-nested.pug │ │ │ ├── include-extends-from-root.pug │ │ │ ├── include-extends-of-common-template.pug │ │ │ ├── include-extends-relative.pug │ │ │ ├── include-filter-coffee.coffee │ │ │ ├── include-filter-stylus.pug │ │ │ ├── include-filter.pug │ │ │ ├── include-only-text-body.pug │ │ │ ├── include-only-text.pug │ │ │ ├── include-with-text-head.pug │ │ │ ├── include-with-text.pug │ │ │ ├── include.script.pug │ │ │ ├── include.yield.nested.pug │ │ │ ├── includes-with-ext-js.pug │ │ │ ├── includes.pug │ │ │ ├── javascript-new-lines.js │ │ │ ├── layout.append.pug │ │ │ ├── layout.append.without-block.pug │ │ │ ├── layout.multi.append.prepend.block.pug │ │ │ ├── layout.prepend.pug │ │ │ ├── layout.prepend.without-block.pug │ │ │ ├── some-included.styl │ │ │ ├── some.md │ │ │ └── some.styl │ │ ├── errors/ │ │ │ ├── child-with-tags.input.json │ │ │ ├── extends-not-first.input.json │ │ │ └── unexpected-block.input.json │ │ ├── errors-src/ │ │ │ ├── child-with-tags.pug │ │ │ ├── extends-not-first.pug │ │ │ └── unexpected-block.pug │ │ ├── fixtures/ │ │ │ ├── append/ │ │ │ │ ├── app-layout.pug │ │ │ │ ├── layout.pug │ │ │ │ ├── page.html │ │ │ │ └── page.pug │ │ │ ├── append-without-block/ │ │ │ │ ├── app-layout.pug │ │ │ │ ├── layout.pug │ │ │ │ └── page.pug │ │ │ ├── empty.pug │ │ │ ├── layout.pug │ │ │ ├── mixins.pug │ │ │ ├── multi-append-prepend-block/ │ │ │ │ ├── redefine.pug │ │ │ │ └── root.pug │ │ │ ├── prepend/ │ │ │ │ ├── app-layout.pug │ │ │ │ ├── layout.pug │ │ │ │ ├── page.html │ │ │ │ └── page.pug │ │ │ └── prepend-without-block/ │ │ │ ├── app-layout.pug │ │ │ ├── layout.pug │ │ │ ├── page.html │ │ │ └── page.pug │ │ ├── index.test.js │ │ ├── special-cases/ │ │ │ ├── extending-empty.input.json │ │ │ ├── extending-include.input.json │ │ │ └── root-mixin.input.json │ │ └── special-cases-src/ │ │ ├── extending-empty.pug │ │ ├── extending-include.pug │ │ └── root-mixin.pug │ ├── pug-load/ │ │ ├── HISTORY.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.js │ │ ├── package.json │ │ └── test/ │ │ ├── __snapshots__/ │ │ │ └── index.test.js.snap │ │ ├── bar.pug │ │ ├── bing.pug │ │ ├── foo.pug │ │ ├── index.test.js │ │ └── script.js │ ├── pug-parser/ │ │ ├── HISTORY.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── index.js │ │ ├── lib/ │ │ │ └── inline-tags.js │ │ ├── package.json │ │ └── test/ │ │ ├── __snapshots__/ │ │ │ ├── index.test.js.snap │ │ │ └── no-unnecessary-blocks.test.js.snap │ │ ├── cases/ │ │ │ ├── attr-es2015.tokens.json │ │ │ ├── attrs-data.tokens.json │ │ │ ├── attrs.js.tokens.json │ │ │ ├── attrs.tokens.json │ │ │ ├── attrs.unescaped.tokens.json │ │ │ ├── basic.tokens.json │ │ │ ├── blanks.tokens.json │ │ │ ├── block-code.tokens.json │ │ │ ├── block-expansion.shorthands.tokens.json │ │ │ ├── block-expansion.tokens.json │ │ │ ├── blockquote.tokens.json │ │ │ ├── blocks-in-blocks.tokens.json │ │ │ ├── blocks-in-if.tokens.json │ │ │ ├── case-blocks.tokens.json │ │ │ ├── case.tokens.json │ │ │ ├── classes-empty.tokens.json │ │ │ ├── classes.tokens.json │ │ │ ├── code.conditionals.tokens.json │ │ │ ├── code.escape.tokens.json │ │ │ ├── code.iteration.tokens.json │ │ │ ├── code.tokens.json │ │ │ ├── comments-in-case.tokens.json │ │ │ ├── comments.source.tokens.json │ │ │ ├── comments.tokens.json │ │ │ ├── doctype.custom.tokens.json │ │ │ ├── doctype.default.tokens.json │ │ │ ├── doctype.keyword.tokens.json │ │ │ ├── each.else.tokens.json │ │ │ ├── escape-chars.tokens.json │ │ │ ├── escape-test.tokens.json │ │ │ ├── escaping-class-attribute.tokens.json │ │ │ ├── filter-in-include.tokens.json │ │ │ ├── filters-empty.tokens.json │ │ │ ├── filters.coffeescript.tokens.json │ │ │ ├── filters.custom.tokens.json │ │ │ ├── filters.include.custom.tokens.json │ │ │ ├── filters.include.tokens.json │ │ │ ├── filters.inline.tokens.json │ │ │ ├── filters.less.tokens.json │ │ │ ├── filters.markdown.tokens.json │ │ │ ├── filters.nested.tokens.json │ │ │ ├── filters.stylus.tokens.json │ │ │ ├── filters.verbatim.tokens.json │ │ │ ├── html.tokens.json │ │ │ ├── html5.tokens.json │ │ │ ├── include-extends-from-root.tokens.json │ │ │ ├── include-extends-of-common-template.tokens.json │ │ │ ├── include-extends-relative.tokens.json │ │ │ ├── include-only-text-body.tokens.json │ │ │ ├── include-only-text.tokens.json │ │ │ ├── include-with-text-head.tokens.json │ │ │ ├── include-with-text.tokens.json │ │ │ ├── include.script.tokens.json │ │ │ ├── include.yield.nested.tokens.json │ │ │ ├── includes-with-ext-js.tokens.json │ │ │ ├── includes.tokens.json │ │ │ ├── inheritance.alert-dialog.tokens.json │ │ │ ├── inheritance.defaults.tokens.json │ │ │ ├── inheritance.extend.include.tokens.json │ │ │ ├── inheritance.extend.mixins.block.tokens.json │ │ │ ├── inheritance.extend.mixins.tokens.json │ │ │ ├── inheritance.extend.recursive.tokens.json │ │ │ ├── inheritance.extend.tokens.json │ │ │ ├── inheritance.extend.whitespace.tokens.json │ │ │ ├── inheritance.tokens.json │ │ │ ├── inline-block-comment.tokens.json │ │ │ ├── inline-tag.tokens.json │ │ │ ├── intepolated-elements.tokens.json │ │ │ ├── interpolated-mixin.tokens.json │ │ │ ├── interpolation.escape.tokens.json │ │ │ ├── layout.append.tokens.json │ │ │ ├── layout.append.without-block.tokens.json │ │ │ ├── layout.multi.append.prepend.block.tokens.json │ │ │ ├── layout.prepend.tokens.json │ │ │ ├── layout.prepend.without-block.tokens.json │ │ │ ├── mixin-at-end-of-file.tokens.json │ │ │ ├── mixin-block-with-space.tokens.json │ │ │ ├── mixin-hoist.tokens.json │ │ │ ├── mixin-via-include.tokens.json │ │ │ ├── mixin.attrs.tokens.json │ │ │ ├── mixin.block-tag-behaviour.tokens.json │ │ │ ├── mixin.blocks.tokens.json │ │ │ ├── mixin.merge.tokens.json │ │ │ ├── mixins-unused.tokens.json │ │ │ ├── mixins.rest-args.tokens.json │ │ │ ├── mixins.tokens.json │ │ │ ├── namespaces.tokens.json │ │ │ ├── nesting.tokens.json │ │ │ ├── pipeless-comments.tokens.json │ │ │ ├── pipeless-filters.tokens.json │ │ │ ├── pipeless-tag.tokens.json │ │ │ ├── pre.tokens.json │ │ │ ├── quotes.tokens.json │ │ │ ├── regression.1794.tokens.json │ │ │ ├── regression.784.tokens.json │ │ │ ├── script.whitespace.tokens.json │ │ │ ├── scripts.non-js.tokens.json │ │ │ ├── scripts.tokens.json │ │ │ ├── self-closing-html.tokens.json │ │ │ ├── single-period.tokens.json │ │ │ ├── source.tokens.json │ │ │ ├── styles.tokens.json │ │ │ ├── tag-blocks.tokens.json │ │ │ ├── tag.interpolation.tokens.json │ │ │ ├── tags.self-closing.tokens.json │ │ │ ├── template.tokens.json │ │ │ ├── text-block.tokens.json │ │ │ ├── text.tokens.json │ │ │ ├── utf8bom.tokens.json │ │ │ ├── vars.tokens.json │ │ │ ├── while.tokens.json │ │ │ ├── xml.tokens.json │ │ │ ├── yield-before-conditional-head.tokens.json │ │ │ ├── yield-before-conditional.tokens.json │ │ │ ├── yield-head.tokens.json │ │ │ ├── yield-title-head.tokens.json │ │ │ ├── yield-title.tokens.json │ │ │ └── yield.tokens.json │ │ ├── index.test.js │ │ └── no-unnecessary-blocks.test.js │ ├── pug-runtime/ │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.js │ │ ├── index.js │ │ ├── package.json │ │ ├── prepublish.js │ │ ├── test/ │ │ │ └── index.test.js │ │ └── wrap.js │ ├── pug-strip-comments/ │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── index.js │ │ ├── package.json │ │ └── test/ │ │ ├── __snapshots__/ │ │ │ └── index.test.js.snap │ │ ├── cases/ │ │ │ ├── comments-in-case.input.json │ │ │ ├── comments.input.json │ │ │ └── comments.source.input.json │ │ ├── errors/ │ │ │ ├── comment-in-comment.input.json │ │ │ ├── end.input.json │ │ │ └── startstart.input.json │ │ └── index.test.js │ └── pug-walk/ │ ├── .gitignore │ ├── .travis.yml │ ├── HISTORY.md │ ├── LICENSE │ ├── README.md │ ├── index.js │ ├── package.json │ └── test/ │ └── index.test.js ├── scripts/ │ ├── buffer-serializer.js │ ├── filename-serializer.js │ ├── prebuild.js │ └── prettier-javascript-serializer.js └── tsconfig.json
SYMBOL INDEX (125 symbols across 31 files)
FILE: packages/pug-attrs/index.js
function isConstant (line 8) | function isConstant(src) {
function toConstant (line 11) | function toConstant(src) {
function compileAttrs (line 22) | function compileAttrs(attrs, options) {
FILE: packages/pug-attrs/test/index.test.js
function test (line 8) | function test(input, expected, locals) {
function withOptions (line 34) | function withOptions(opts, fn) {
FILE: packages/pug-code-gen/index.js
function generateCode (line 31) | function generateCode(ast, options) {
function isConstant (line 35) | function isConstant(src) {
function toConstant (line 38) | function toConstant(src) {
function isIdentifier (line 42) | function isIdentifier(name) {
function Compiler (line 54) | function Compiler(node, options) {
function bufferName (line 643) | function bufferName() {
function tagCanInline (line 1021) | function tagCanInline(tag) {
FILE: packages/pug-error/src/index.ts
function makeError (line 1) | function makeError(
FILE: packages/pug-error/test/index.test.js
function check (line 106) | function check(line) {
FILE: packages/pug-filters/lib/handle-filters.js
function handleFilters (line 10) | function handleFilters(ast, filters, options, filterAliases) {
function handleNestedFilters (line 100) | function handleNestedFilters(node, filters, options, filterAliases) {
function getBodyAsText (line 111) | function getBodyAsText(node) {
function getAttributes (line 119) | function getAttributes(node, options) {
FILE: packages/pug-filters/lib/run-filter.js
function getMinifyTransformerName (line 8) | function getMinifyTransformerName(outputFormat) {
function filter (line 17) | function filter(name, str, options, currentDirectory, funcName) {
FILE: packages/pug-filters/test/index.test.js
function read (line 17) | function read(path) {
function read (line 36) | function read(path) {
FILE: packages/pug-lexer/index.d.ts
type Loc (line 3) | interface Loc {
type LexTokenType (line 8) | type LexTokenType =
type LexToken (line 54) | interface LexToken<Type extends LexTokenType> {
type TagToken (line 59) | interface TagToken extends LexToken<'tag'> {
type StartAttributesToken (line 63) | type StartAttributesToken = LexToken<'start-attributes'>;
type AttributeToken (line 65) | interface AttributeToken extends LexToken<'attribute'> {
type EndAttributesToken (line 71) | type EndAttributesToken = LexToken<'end-attributes'>;
type IndentToken (line 73) | interface IndentToken extends LexToken<'indent'> {
type ClassToken (line 77) | interface ClassToken extends LexToken<'class'> {
type OutdentToken (line 81) | type OutdentToken = LexToken<'outdent'>;
type EosToken (line 83) | type EosToken = LexToken<'eos'>;
type CommentToken (line 85) | interface CommentToken extends LexToken<'comment'> {
type NewlineToken (line 90) | type NewlineToken = LexToken<'newline'>;
type TextToken (line 92) | interface TextToken extends LexToken<'text'> {
type InterpolatedCodeToken (line 96) | interface InterpolatedCodeToken
type CodeToken (line 103) | interface CodeToken extends LexToken<'code'> {
type IdToken (line 109) | interface IdToken extends LexToken<'id'> {
type StartPipelessTextToken (line 113) | type StartPipelessTextToken = LexToken<'start-pipeless-text'>;
type EndPipelessTextToken (line 115) | type EndPipelessTextToken = LexToken<'end-pipeless-text'>;
type DoctypeToken (line 117) | interface DoctypeToken extends LexToken<'doctype'> {
type DotToken (line 121) | type DotToken = LexToken<'dot'>;
type BlockToken (line 123) | interface BlockToken extends LexToken<'block'> {
type ExtendsToken (line 128) | type ExtendsToken = LexToken<'extends'>;
type PathToken (line 130) | interface PathToken extends LexToken<'path'> {
type StartPugInterpolationToken (line 134) | type StartPugInterpolationToken = LexToken<
type EndPugInterpolationToken (line 138) | type EndPugInterpolationToken = LexToken<'end-pug-interpolation'>;
type InterpolationToken (line 140) | interface InterpolationToken extends LexToken<'interpolation'> {
type IncludeToken (line 144) | type IncludeToken = LexToken<'include'>;
type FilterToken (line 146) | interface FilterToken extends LexToken<'filter'> {
type CallToken (line 150) | interface CallToken extends LexToken<'call'> {
type MixinToken (line 155) | interface MixinToken extends LexToken<'mixin'> {
type IfToken (line 160) | interface IfToken extends LexToken<'if'> {
type MixinBlockToken (line 164) | type MixinBlockToken = LexToken<'mixin-block'>;
type ElseToken (line 166) | interface ElseToken extends LexToken<'else'> {
type AndAttributesToken (line 170) | interface AndAttributesToken extends LexToken<'&attributes'> {
type TextHtmlToken (line 174) | interface TextHtmlToken extends LexToken<'text-html'> {
type EachToken (line 178) | interface EachToken extends LexToken<'each'> {
type EachOfToken (line 184) | interface EachOfToken extends LexToken<'eachOf'> {
type WhileToken (line 190) | interface WhileToken extends LexToken<'while'> {
type CaseToken (line 194) | interface CaseToken extends LexToken<'case'> {
type WhenToken (line 198) | interface WhenToken extends LexToken<'when'> {
type ColonToken (line 202) | type ColonToken = LexToken<':'>;
type DefaultToken (line 204) | type DefaultToken = LexToken<'default'>;
type ElseIfToken (line 206) | interface ElseIfToken extends LexToken<'else-if'> {
type BlockcodeToken (line 210) | type BlockcodeToken = LexToken<'blockcode'>;
type YieldToken (line 212) | type YieldToken = LexToken<'yield'>;
type SlashToken (line 214) | type SlashToken = LexToken<'slash'>;
type Token (line 216) | type Token =
type LexerFunction (line 262) | type LexerFunction = (type: string, exp?: any) => boolean;
type LexerOptions (line 263) | interface LexerOptions {
class Lexer (line 270) | class Lexer {
FILE: packages/pug-lexer/index.js
function lex (line 10) | function lex(str, options) {
function Lexer (line 23) | function Lexer(str, options) {
FILE: packages/pug-lexer/test/check-lexer-functions.test.js
function checkDirectCalls (line 50) | function checkDirectCalls(node) {
function checkMissingLexerFunction (line 75) | function checkMissingLexerFunction(node) {
FILE: packages/pug-linker/index.js
function error (line 6) | function error() {
function link (line 11) | function link(ast) {
function findDeclaredBlocks (line 71) | function findDeclaredBlocks(ast) /*: {[name: string]: Array<BlockNode>}*/ {
function flattenParentBlocks (line 82) | function flattenParentBlocks(parentBlocks, accumulator) {
function extend (line 93) | function extend(parentBlocks, ast) {
function applyIncludes (line 132) | function applyIncludes(ast, child) {
function removeBlocks (line 151) | function removeBlocks(ast) {
function applyYield (line 162) | function applyYield(ast, block) {
function checkExtendPosition (line 191) | function checkExtendPosition(ast, hasExtends) {
FILE: packages/pug-linker/test/index.test.js
function testDir (line 5) | function testDir(dir) {
function testDirError (line 15) | function testDirError(dir) {
FILE: packages/pug-load/index.js
function load (line 9) | function load(ast, options) {
function getOptions (line 111) | function getOptions(options) {
FILE: packages/pug-parser/index.js
function parse (line 10) | function parse(tokens, options) {
function Parser (line 25) | function Parser(tokens, options) {
FILE: packages/pug-parser/test/index.test.js
function parseNewlineJson (line 10) | function parseNewlineJson(str) {
function read (line 17) | function read(path) {
FILE: packages/pug-runtime/build.js
function build (line 10) | function build(functions) {
FILE: packages/pug-runtime/index.js
function pug_merge (line 18) | function pug_merge(a, b) {
function pug_classes_array (line 63) | function pug_classes_array(val, escaping) {
function pug_classes_object (line 77) | function pug_classes_object(val) {
function pug_classes (line 88) | function pug_classes(val, escaping) {
function pug_style (line 106) | function pug_style(val) {
function pug_attr (line 132) | function pug_attr(key, val, escaped, terse) {
function pug_attrs (line 168) | function pug_attrs(obj, terse) {
function pug_escape (line 200) | function pug_escape(_html) {
function pug_rethrow (line 244) | function pug_rethrow(err, filename, lineno, str) {
FILE: packages/pug-runtime/test/index.test.js
function addTest (line 7) | function addTest(name, fn) {
FILE: packages/pug-runtime/wrap.js
function wrap (line 4) | function wrap(template, templateName) {
FILE: packages/pug-strip-comments/index.js
function unexpectedToken (line 7) | function unexpectedToken(type, occasion, filename, line) {
function stripComments (line 12) | function stripComments(input, options) {
FILE: packages/pug-strip-comments/test/index.test.js
function test (line 14) | function test(name, options) {
FILE: packages/pug-walk/index.js
function walkAST (line 4) | function walkAST(ast, before, after, options) {
FILE: packages/pug/lib/index.js
function applyPlugins (line 43) | function applyPlugins(value, options, plugins, name) {
function findReplacementFunc (line 49) | function findReplacementFunc(plugins, name) {
function compileBody (line 77) | function compileBody(str, options) {
function handleTemplateCache (line 236) | function handleTemplateCache(options, str) {
FILE: packages/pug/register.js
function compileTemplate (line 4) | function compileTemplate(module, filename) {
FILE: packages/pug/support/benchmark.js
function setup (line 17) | function setup(self) {
FILE: packages/pug/test/error.reporting.test.js
function getError (line 11) | function getError(str, options) {
function getFileError (line 19) | function getFileError(name, options) {
FILE: packages/pug/test/plugins.test.js
method advance (line 5) | advance(lexer) {
FILE: packages/pug/test/run-utils.js
function writeFileSync (line 17) | function writeFileSync(filename, data) {
function findCases (line 30) | function findCases(dir) {
function testSingle (line 41) | function testSingle(it, suffix, test) {
FILE: scripts/filename-serializer.js
function matchesBasedir (line 4) | function matchesBasedir(value) {
function removeBasedir (line 10) | function removeBasedir(value) {
FILE: scripts/prebuild.js
constant LICENSE (line 9) | const LICENSE = `Copyright (c) ${new Date().getFullYear()} Forbes Lindesay
Condensed preview — 912 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,211K chars).
[
{
"path": ".editorconfig",
"chars": 161,
"preview": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\ntab_width = 2\nend_of_line = lf\ninsert_final_newlin"
},
{
"path": ".gitattributes",
"chars": 21,
"preview": "* text=auto eol=lf\n"
},
{
"path": ".github/FUNDING.yml",
"chars": 573,
"preview": "# These are supported funding model platforms\n\ngithub: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [u"
},
{
"path": ".github/ISSUE_TEMPLATE.md",
"chars": 727,
"preview": "<!-- For bugs and feature request, please fillin the following -->\n<!-- For general questions, please use the pug tag on"
},
{
"path": ".github/workflows/rollingversions.yml",
"chars": 1534,
"preview": "name: Release\non:\n push:\n branches:\n - master\n repository_dispatch:\n types: [rollingversions_publish_approv"
},
{
"path": ".github/workflows/test.yml",
"chars": 473,
"preview": "name: Test\n\non:\n pull_request:\n branches:\n - master\n\njobs:\n test:\n runs-on: ubuntu-latest\n\n strategy:\n "
},
{
"path": ".gitignore",
"chars": 227,
"preview": ".DS_Store\n.idea\n.vscode\ntesting\nnode_modules\nlib-cov\ncoverage\ncov-pt*\n*.seed\n*.log\n*.csv\n*.dat\n*.out\n*.patch\n*.pid\n*.gz\n"
},
{
"path": ".prettierrc.js",
"chars": 227,
"preview": "module.exports = {\n bracketSpacing: false,\n singleQuote: true,\n trailingComma: 'all',\n overrides: [\n {\n file"
},
{
"path": "README.md",
"chars": 18156,
"preview": "<a href=\"https://pugjs.org\"><img src=\"https://cdn.rawgit.com/pugjs/pug-logo/eec436cee8fd9d1726d7839cbe99d1f694692c0c/SVG"
},
{
"path": "SECURITY.md",
"chars": 369,
"preview": "# Security Policy\n\n## Supported Versions\n\n| Version | Supported |\n| -------- | ------------------ |\n| ^3.0.1 "
},
{
"path": "package.json",
"chars": 1100,
"preview": "{\n \"name\": \"pug-monorepo\",\n \"private\": true,\n \"@rollingversions/ignore\": true,\n \"workspaces\": [\n \"packages/*\"\n ]"
},
{
"path": "packages/pug/History.md",
"chars": 37093,
"preview": "1.11.0 / 2015-06-12\n==================\n\n * Added block code support ([@alephyud](https://github.com/alephyud))\n * Impr"
},
{
"path": "packages/pug/LICENSE",
"chars": 1103,
"preview": "(The MIT License)\n\nCopyright (c) 2009-2014 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of ch"
},
{
"path": "packages/pug/README.md",
"chars": 6468,
"preview": "<!-- Coppied from root directory -->\n\n<a href=\"https://pugjs.org\"><img src=\"https://cdn.rawgit.com/pugjs/pug-logo/eec436"
},
{
"path": "packages/pug/examples/README.md",
"chars": 141,
"preview": "The examples in this directory can be run simply by something like. \n\n node attributes.js\n\nYou can also open `browser"
},
{
"path": "packages/pug/examples/attributes.js",
"chars": 238,
"preview": "/**\n * Module dependencies.\n */\n\nvar pug = require('../'),\n path = __dirname + '/attributes.pug',\n str = require('fs')"
},
{
"path": "packages/pug/examples/attributes.pug",
"chars": 286,
"preview": "div#id.left.container(class='user user-' + name)\n h1.title= name\n form\n //- unbuffered comment :)\n // An example"
},
{
"path": "packages/pug/examples/code.js",
"chars": 375,
"preview": "/**\n * Module dependencies.\n */\n\nvar pug = require('../'),\n path = __dirname + '/code.pug',\n str = require('fs').readF"
},
{
"path": "packages/pug/examples/code.pug",
"chars": 382,
"preview": "\n- var title = \"Things\"\n\n-\n var subtitle = [\"Really\", \"long\",\n \"list\", \"of\",\n \"words"
},
{
"path": "packages/pug/examples/dynamicscript.js",
"chars": 307,
"preview": "/**\n * Module dependencies.\n */\n\nvar pug = require('../');\n\nvar locals = {\n users: {\n tj: {age: 23, email: 'tj@visio"
},
{
"path": "packages/pug/examples/dynamicscript.pug",
"chars": 127,
"preview": "html\n head\n title Dynamic Inline JavaScript\n script.\n var users = !{JSON.stringify(users).replace(/<\\//g, \"<"
},
{
"path": "packages/pug/examples/each.js",
"chars": 375,
"preview": "/**\n * Module dependencies.\n */\n\nvar pug = require('../'),\n path = __dirname + '/each.pug',\n str = require('fs').readF"
},
{
"path": "packages/pug/examples/each.pug",
"chars": 86,
"preview": "ul#users\n each user, name in users\n li(class='user-' + name) #{name} #{user.email}"
},
{
"path": "packages/pug/examples/extend-layout.pug",
"chars": 170,
"preview": "html\n head\n h1 My Site - #{title}\n block scripts\n script(src='/jquery.js')\n body\n block content\n bloc"
},
{
"path": "packages/pug/examples/extend.js",
"chars": 386,
"preview": "/**\n * Module dependencies.\n */\n\nvar pug = require('../'),\n path = __dirname + '/extend.pug',\n str = require('fs').rea"
},
{
"path": "packages/pug/examples/extend.pug",
"chars": 160,
"preview": "\nextends extend-layout.pug\n\nblock scripts\n script(src='/jquery.js')\n script(src='/pets.js')\n\nblock content\n h1= title"
},
{
"path": "packages/pug/examples/form.js",
"chars": 332,
"preview": "/**\n * Module dependencies.\n */\n\nvar pug = require('../'),\n path = __dirname + '/form.pug',\n str = require('fs').readF"
},
{
"path": "packages/pug/examples/form.pug",
"chars": 878,
"preview": "form(method=\"post\")\n fieldset\n legend General\n p\n label(for=\"user[name]\") Username:\n input(type=\"text"
},
{
"path": "packages/pug/examples/includes/foot.pug",
"chars": 32,
"preview": "#footer\n p Copyright (c) foobar"
},
{
"path": "packages/pug/examples/includes/head.pug",
"chars": 132,
"preview": "head\n title My Site\n // including other pug works\n include scripts.pug\n // including .html, .css, etc works\n includ"
},
{
"path": "packages/pug/examples/includes/scripts.pug",
"chars": 71,
"preview": "script(src='/javascripts/jquery.js')\nscript(src='/javascripts/app.js')\n"
},
{
"path": "packages/pug/examples/includes/style.css",
"chars": 48,
"preview": "<style>\n body {\n padding: 50px;\n }\n</style>"
},
{
"path": "packages/pug/examples/includes.js",
"chars": 224,
"preview": "/**\n * Module dependencies.\n */\n\nvar pug = require('../'),\n path = __dirname + '/includes.pug',\n str = require('fs').r"
},
{
"path": "packages/pug/examples/includes.pug",
"chars": 123,
"preview": "\nhtml\n include includes/head.pug\n body\n h1 My Site\n p Welcome to my super lame site.\n include includes/foot.p"
},
{
"path": "packages/pug/examples/layout-debug.js",
"chars": 186,
"preview": "/**\n * Module dependencies.\n */\n\nvar pug = require('../');\n\npug.renderFile(__dirname + '/layout.pug', {debug: true}, fun"
},
{
"path": "packages/pug/examples/layout.js",
"chars": 222,
"preview": "/**\n * Module dependencies.\n */\n\nvar pug = require('../'),\n path = __dirname + '/layout.pug',\n str = require('fs').rea"
},
{
"path": "packages/pug/examples/layout.pug",
"chars": 379,
"preview": "doctype html\nhtml(lang=\"en\")\n head\n title Example\n script.\n if (foo) {\n bar();\n }\n body\n h1 "
},
{
"path": "packages/pug/examples/mixins/dialog.pug",
"chars": 186,
"preview": "\nmixin dialog\n .dialog\n h1 Whoop\n p stuff\n\nmixin dialog-title(title)\n .dialog\n h1= title\n p stuff\n\nmixin d"
},
{
"path": "packages/pug/examples/mixins/profile.pug",
"chars": 131,
"preview": "\nmixin pets(pets)\n ul.pets\n each pet in pets\n li= pet\n\nmixin profile(user)\n .user\n h2= user.name\n +pets("
},
{
"path": "packages/pug/examples/mixins.js",
"chars": 308,
"preview": "/**\n * Module dependencies.\n */\n\nvar pug = require('../'),\n path = __dirname + '/mixins.pug',\n str = require('fs').rea"
},
{
"path": "packages/pug/examples/mixins.pug",
"chars": 181,
"preview": "include mixins/dialog.pug\ninclude mixins/profile.pug\n\n.one\n +dialog\n\n.two\n +dialog-title('Whoop')\n\n.three\n +dialog-ti"
},
{
"path": "packages/pug/examples/pet.pug",
"chars": 71,
"preview": ".pet\n h2= pet.name\n p #{pet.name} is <em>#{pet.age}</em> year(s) old."
},
{
"path": "packages/pug/examples/rss.js",
"chars": 533,
"preview": "/**\n * Module dependencies.\n */\n\nvar pug = require('../'),\n path = __dirname + '/rss.pug',\n str = require('fs').readFi"
},
{
"path": "packages/pug/examples/rss.pug",
"chars": 321,
"preview": "doctype xml\nrss(version='2.0')\nchannel\n title RSS Title\n description Some description here\n link http://google.com\n "
},
{
"path": "packages/pug/examples/text.js",
"chars": 261,
"preview": "/**\n * Module dependencies.\n */\n\nvar pug = require('../'),\n path = __dirname + '/text.pug',\n str = require('fs').readF"
},
{
"path": "packages/pug/examples/text.pug",
"chars": 764,
"preview": "| An example of an\na(href='#') inline\n| link.\n\nform\n label Username:\n input(type='text', name='user[name]')\n p\n "
},
{
"path": "packages/pug/examples/whitespace.js",
"chars": 226,
"preview": "/**\n * Module dependencies.\n */\n\nvar pug = require('../'),\n path = __dirname + '/whitespace.pug',\n str = require('fs')"
},
{
"path": "packages/pug/examples/whitespace.pug",
"chars": 126,
"preview": "- var js = '<script></script>'\ndoctype html\nhtml\n \n head\n title= \"Some \" + \"JavaScript\"\n != js\n \n \n \n bo"
},
{
"path": "packages/pug/lib/index.js",
"chars": 12912,
"preview": "'use strict';\n\n/*!\n * Pug\n * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>\n * MIT Licensed\n */\n\n/**\n * Module de"
},
{
"path": "packages/pug/package.json",
"chars": 1577,
"preview": "{\n \"name\": \"pug\",\n \"description\": \"A clean, whitespace-sensitive template language for writing HTML\",\n \"keywords\": [\n"
},
{
"path": "packages/pug/register.js",
"chars": 465,
"preview": "var pug = require('./');\nvar resolvedPug = JSON.stringify(require.resolve('./'));\n\nfunction compileTemplate(module, file"
},
{
"path": "packages/pug/support/benchmark.js",
"chars": 2201,
"preview": "/**\n * Module dependencies.\n */\n\nvar uubench = require('uubench'),\n pug = require('../');\n\nvar suite = new uubench.Suit"
},
{
"path": "packages/pug/test/README.md",
"chars": 164,
"preview": "# Running Tests\n\nTo run tests (with node.js installed) you must complete 2 steps.\n\n## 1 Install dependencies\n\n```\nnpm in"
},
{
"path": "packages/pug/test/__snapshots__/pug.test.js.snap",
"chars": 3015,
"preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`pug .compileClient() should support module syntax in pug.compileCli"
},
{
"path": "packages/pug/test/anti-cases/attrs.unescaped.pug",
"chars": 90,
"preview": "script(type='text/x-template')\n #user(id!='user-<%= user.id %>')\n h1 <%= user.title %>"
},
{
"path": "packages/pug/test/anti-cases/case-when.pug",
"chars": 27,
"preview": "when 5\n .foo\nwhen 6\n .bar"
},
{
"path": "packages/pug/test/anti-cases/case-without-with.pug",
"chars": 15,
"preview": "case foo\n .div"
},
{
"path": "packages/pug/test/anti-cases/else-condition.pug",
"chars": 31,
"preview": "if foo\n div\nelse bar\n article"
},
{
"path": "packages/pug/test/anti-cases/else-without-if.pug",
"chars": 11,
"preview": "else\n .foo"
},
{
"path": "packages/pug/test/anti-cases/inlining-a-mixin-after-a-tag.pug",
"chars": 11,
"preview": "foo()+bar()"
},
{
"path": "packages/pug/test/anti-cases/key-char-ending-badly.pug",
"chars": 14,
"preview": "div(\"foo\"abc)\n"
},
{
"path": "packages/pug/test/anti-cases/key-ending-badly.pug",
"chars": 14,
"preview": "div(foo!~abc)\n"
},
{
"path": "packages/pug/test/anti-cases/mismatched-inline-tag.pug",
"chars": 24,
"preview": "//- #1871\np #[strong a}\n"
},
{
"path": "packages/pug/test/anti-cases/mixin-args-syntax-error.pug",
"chars": 30,
"preview": "mixin foo(a, b)\n+foo('a'b'b')\n"
},
{
"path": "packages/pug/test/anti-cases/mixins-blocks-with-bodies.pug",
"chars": 25,
"preview": "mixin foo\n block\n bar"
},
{
"path": "packages/pug/test/anti-cases/multiple-non-nested-tags-on-a-line.pug",
"chars": 8,
"preview": "foo()bar"
},
{
"path": "packages/pug/test/anti-cases/non-existant-filter.pug",
"chars": 29,
"preview": ":not-a-valid-filter\n foo bar"
},
{
"path": "packages/pug/test/anti-cases/non-mixin-block.pug",
"chars": 11,
"preview": "div\n block"
},
{
"path": "packages/pug/test/anti-cases/open-brace-in-attributes.pug",
"chars": 12,
"preview": "div(title=[)"
},
{
"path": "packages/pug/test/anti-cases/readme.md",
"chars": 240,
"preview": "This folder collects examples of files that are not valid `pug`, but were at some point accepted by the parser without t"
},
{
"path": "packages/pug/test/anti-cases/self-closing-tag-with-block.pug",
"chars": 37,
"preview": "input\n | Inputs cannot have content\n"
},
{
"path": "packages/pug/test/anti-cases/self-closing-tag-with-body.pug",
"chars": 32,
"preview": "input Input's can't have content"
},
{
"path": "packages/pug/test/anti-cases/self-closing-tag-with-code.pug",
"chars": 33,
"preview": "input= 'Inputs cannot have code'\n"
},
{
"path": "packages/pug/test/anti-cases/tabs-and-spaces.pug",
"chars": 18,
"preview": "div\n div\n\tarticle"
},
{
"path": "packages/pug/test/anti-cases/unclosed-interpolated-call.pug",
"chars": 10,
"preview": "+#{myMixin"
},
{
"path": "packages/pug/test/anti-cases/unclosed-interpolated-tag.pug",
"chars": 34,
"preview": "mixin item\n block\n\n+item( Contact"
},
{
"path": "packages/pug/test/anti-cases/unclosed-interpolation.pug",
"chars": 9,
"preview": "#{myMixin"
},
{
"path": "packages/pug/test/browser/index.html",
"chars": 605,
"preview": "<!DOCTYPE html><html><head></head><body><textarea id=\"input\" placeholder=\"write pug here\" style=\"width: 100%; min-height"
},
{
"path": "packages/pug/test/browser/index.pug",
"chars": 614,
"preview": "!!! 5\nhtml\n head\n body\n textarea#input(placeholder='write pug here', style='width: 100%; min-height: 400px;').\n "
},
{
"path": "packages/pug/test/cases/attrs-data.html",
"chars": 347,
"preview": "<foo data-user=\"{"name":"tobi"}\"></foo>\n<foo data-items=\"[1,2,3]\"></foo>\n<foo data-username=\"tobi\"><"
},
{
"path": "packages/pug/test/cases/attrs-data.pug",
"chars": 231,
"preview": "- var user = { name: 'tobi' }\nfoo(data-user=user)\nfoo(data-items=[1,2,3])\nfoo(data-username='tobi')\nfoo(data-escaped={me"
},
{
"path": "packages/pug/test/cases/attrs.colon.html",
"chars": 267,
"preview": "<div :my-var=\"model\"></div><span v-for=\"item in items\" :key=\"item.id\" :value=\"item.name\"></span><span v-for=\"item in ite"
},
{
"path": "packages/pug/test/cases/attrs.colon.pug",
"chars": 349,
"preview": "//- Tests for using a colon-prefexed attribute (typical when using short-cut for Vue.js `v-bind`)\ndiv(:my-var=\"model\")\ns"
},
{
"path": "packages/pug/test/cases/attrs.html",
"chars": 1034,
"preview": "<a href=\"/contact\">contact</a><a class=\"button\" href=\"/save\">save</a><a foo=\"foo\" bar=\"bar\" baz=\"baz\"></a><a foo=\"foo, b"
},
{
"path": "packages/pug/test/cases/attrs.js.html",
"chars": 399,
"preview": "<a class=\"button\" href=\"/user/5\"></a><a class=\"button\" href=\"/user/5\"></a>\n<meta key=\"answer\" value=\"42\"/><a class=\"clas"
},
{
"path": "packages/pug/test/cases/attrs.js.pug",
"chars": 533,
"preview": "- var id = 5\n- function answer() { return 42; }\na(href='/user/' + id, class='button')\na(href = '/user/' + id, class ="
},
{
"path": "packages/pug/test/cases/attrs.pug",
"chars": 761,
"preview": "a(href='/contact') contact\na(href='/save').button save\na(foo, bar, baz)\na(foo='foo, bar, baz', bar=1)\na(foo='((foo))', b"
},
{
"path": "packages/pug/test/cases/attrs.unescaped.html",
"chars": 114,
"preview": "<script type=\"text/x-template\">\n <div id=\"user-<%= user.id %>\">\n <h1><%= user.title %></h1>\n </div>\n</script>"
},
{
"path": "packages/pug/test/cases/attrs.unescaped.pug",
"chars": 88,
"preview": "script(type='text/x-template')\n div(id!='user-<%= user.id %>')\n h1 <%= user.title %>"
},
{
"path": "packages/pug/test/cases/auxiliary/1794-extends.pug",
"chars": 13,
"preview": "block content"
},
{
"path": "packages/pug/test/cases/auxiliary/1794-include.pug",
"chars": 53,
"preview": "mixin test()\n .test&attributes(attributes)\n \n+test()"
},
{
"path": "packages/pug/test/cases/auxiliary/blocks-in-blocks-layout.pug",
"chars": 110,
"preview": "doctype html\nhtml\n head\n title Default title\n body\n block body\n .container\n block content\n"
},
{
"path": "packages/pug/test/cases/auxiliary/dialog.pug",
"chars": 70,
"preview": "\nextends window.pug\n\nblock window-content\n .dialog\n block content\n"
},
{
"path": "packages/pug/test/cases/auxiliary/empty-block.pug",
"chars": 12,
"preview": "block test\n\n"
},
{
"path": "packages/pug/test/cases/auxiliary/escapes.html",
"chars": 44,
"preview": "<script>\n console.log(\"foo\\nbar\")\n</script>"
},
{
"path": "packages/pug/test/cases/auxiliary/extends-empty-block-1.pug",
"chars": 51,
"preview": "extends empty-block.pug\n\nblock test\n div test1\n\n"
},
{
"path": "packages/pug/test/cases/auxiliary/extends-empty-block-2.pug",
"chars": 51,
"preview": "extends empty-block.pug\n\nblock test\n div test2\n\n"
},
{
"path": "packages/pug/test/cases/auxiliary/extends-from-root.pug",
"chars": 90,
"preview": "extends /auxiliary/layout.pug\n\nblock content\n include /auxiliary/include-from-root.pug\n"
},
{
"path": "packages/pug/test/cases/auxiliary/extends-relative.pug",
"chars": 104,
"preview": "extends ../../cases/auxiliary/layout\n\nblock content\n include ../../cases/auxiliary/include-from-root\n"
},
{
"path": "packages/pug/test/cases/auxiliary/filter-in-include.pug",
"chars": 121,
"preview": "html\n head\n style(type=\"text/css\")\n :less\n @pad: 15px;\n body {\n padding: @pad;\n }"
},
{
"path": "packages/pug/test/cases/auxiliary/includable.js",
"chars": 145,
"preview": "var STRING_SUBSTITUTIONS = {\n // table of character substitutions\n '\\t': '\\\\t',\n '\\r': '\\\\r',\n '\\n': '\\\\n',\n '\"': '"
},
{
"path": "packages/pug/test/cases/auxiliary/include-from-root.pug",
"chars": 8,
"preview": "h1 hello"
},
{
"path": "packages/pug/test/cases/auxiliary/inheritance.extend.mixin.block.pug",
"chars": 129,
"preview": "mixin article()\n article\n block\n\nhtml\n head\n title My Application\n block head\n body\n +article\n block"
},
{
"path": "packages/pug/test/cases/auxiliary/inheritance.extend.recursive-grand-grandparent.pug",
"chars": 44,
"preview": "h1 grand-grandparent\nblock grand-grandparent"
},
{
"path": "packages/pug/test/cases/auxiliary/inheritance.extend.recursive-grandparent.pug",
"chars": 126,
"preview": "extends inheritance.extend.recursive-grand-grandparent.pug\n\nblock grand-grandparent\n h2 grandparent\n block grandpa"
},
{
"path": "packages/pug/test/cases/auxiliary/inheritance.extend.recursive-parent.pug",
"chars": 102,
"preview": "extends inheritance.extend.recursive-grandparent.pug\n\nblock grandparent\n h3 parent\n block parent"
},
{
"path": "packages/pug/test/cases/auxiliary/layout.include.pug",
"chars": 100,
"preview": "html\n head\n title My Application\n block head\n body\n block content\n include window.pug\n"
},
{
"path": "packages/pug/test/cases/auxiliary/layout.pug",
"chars": 76,
"preview": "html\n head\n title My Application\n block head\n body\n block content"
},
{
"path": "packages/pug/test/cases/auxiliary/mixin-at-end-of-file.pug",
"chars": 37,
"preview": "mixin slide\n section.slide\n block"
},
{
"path": "packages/pug/test/cases/auxiliary/mixins.pug",
"chars": 20,
"preview": "\nmixin foo()\n p bar"
},
{
"path": "packages/pug/test/cases/auxiliary/pet.pug",
"chars": 68,
"preview": ".pet\n h1 {{name}}\n p {{name}} is a {{species}} that is {{age}} old"
},
{
"path": "packages/pug/test/cases/auxiliary/smile.html",
"chars": 9,
"preview": "<p>:)</p>"
},
{
"path": "packages/pug/test/cases/auxiliary/window.pug",
"chars": 57,
"preview": "\n.window\n a(href='#').close Close\n block window-content"
},
{
"path": "packages/pug/test/cases/auxiliary/yield-nested.pug",
"chars": 114,
"preview": "html\n head\n title\n body\n h1 Page\n #content\n #content-wrapper\n yield\n #footer\n stuff"
},
{
"path": "packages/pug/test/cases/basic.html",
"chars": 52,
"preview": "<html>\n <body>\n <h1>Title</h1>\n </body>\n</html>"
},
{
"path": "packages/pug/test/cases/basic.pug",
"chars": 24,
"preview": "html\n body\n h1 Title"
},
{
"path": "packages/pug/test/cases/blanks.html",
"chars": 55,
"preview": "<ul>\n <li>foo</li>\n <li>bar</li>\n <li>baz</li>\n</ul>"
},
{
"path": "packages/pug/test/cases/blanks.pug",
"chars": 40,
"preview": "\n\nul\n li foo\n\n li bar\n \n li baz\n"
},
{
"path": "packages/pug/test/cases/block-code.html",
"chars": 86,
"preview": "\n<li>Uno</li>\n<li>Dos</li>\n<li>Tres</li>\n<li>Cuatro</li>\n<li>Cinco</li>\n<li>Seis</li>\n"
},
{
"path": "packages/pug/test/cases/block-code.pug",
"chars": 254,
"preview": "-\n list = [\"uno\", \"dos\", \"tres\",\n \"cuatro\", \"cinco\", \"seis\"];\n//- Without a block, the element is accepted and"
},
{
"path": "packages/pug/test/cases/block-expansion.html",
"chars": 83,
"preview": "<ul>\n <li><a href=\"#\">foo</a></li>\n <li><a href=\"#\">bar</a></li>\n</ul>\n<p>baz</p>"
},
{
"path": "packages/pug/test/cases/block-expansion.pug",
"chars": 53,
"preview": "ul\n li: a(href='#') foo\n li: a(href='#') bar\n\np baz"
},
{
"path": "packages/pug/test/cases/block-expansion.shorthands.html",
"chars": 106,
"preview": "<ul>\n <li class=\"list-item\">\n <div class=\"foo\">\n <div id=\"bar\">baz</div>\n </div>\n </li>\n</ul>"
},
{
"path": "packages/pug/test/cases/block-expansion.shorthands.pug",
"chars": 33,
"preview": "ul\n li.list-item: .foo: #bar baz"
},
{
"path": "packages/pug/test/cases/blockquote.html",
"chars": 223,
"preview": "<figure>\n <blockquote>Try to define yourself by what you do, and you’ll burnout every time. You are. That is enou"
},
{
"path": "packages/pug/test/cases/blockquote.pug",
"chars": 189,
"preview": "figure\n blockquote\n | Try to define yourself by what you do, and you’ll burnout every time. You are. That is e"
},
{
"path": "packages/pug/test/cases/blocks-in-blocks.html",
"chars": 122,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <title>Default title</title>\n </head>\n <body>\n <h1>Page 2</h1>\n </body>\n</html"
},
{
"path": "packages/pug/test/cases/blocks-in-blocks.pug",
"chars": 72,
"preview": "extends ./auxiliary/blocks-in-blocks-layout.pug\n\nblock body\n h1 Page 2\n"
},
{
"path": "packages/pug/test/cases/blocks-in-if.html",
"chars": 21,
"preview": "<p>ajax contents</p>\n"
},
{
"path": "packages/pug/test/cases/blocks-in-if.pug",
"chars": 382,
"preview": "//- see https://github.com/pugjs/pug/issues/1589\n\n-var ajax = true\n\n-if( ajax )\n //- return only contents if ajax req"
},
{
"path": "packages/pug/test/cases/case-blocks.html",
"chars": 62,
"preview": "<html>\n <body>\n <p>you have a friend</p>\n </body>\n</html>"
},
{
"path": "packages/pug/test/cases/case-blocks.pug",
"chars": 186,
"preview": "html\n body\n - var friends = 1\n case friends\n when 0\n p you have no friends\n when 1\n p you"
},
{
"path": "packages/pug/test/cases/case.html",
"chars": 130,
"preview": "\n<html>\n <body>\n <p>you have a friend</p>\n <p>you have very few friends</p>\n <p>Friend is a string</p>\n </bod"
},
{
"path": "packages/pug/test/cases/case.pug",
"chars": 452,
"preview": "html\n body\n - var friends = 1\n case friends\n when 0: p you have no friends\n when 1: p you have a friend"
},
{
"path": "packages/pug/test/cases/classes-empty.html",
"chars": 21,
"preview": "<a></a><a></a><a></a>"
},
{
"path": "packages/pug/test/cases/classes-empty.pug",
"chars": 44,
"preview": "a(class='')\na(class=null)\na(class=undefined)"
},
{
"path": "packages/pug/test/cases/classes.html",
"chars": 105,
"preview": "<a class=\"foo bar baz\"></a><a class=\"foo bar baz\"></a><a class=\"foo-bar_baz\"></a><a class=\"foo baz\"></a>\n"
},
{
"path": "packages/pug/test/cases/classes.pug",
"chars": 119,
"preview": "a(class=['foo', 'bar', 'baz'])\n\n\n\na.foo(class='bar').baz\n\n\n\na.foo-bar_baz\n\na(class={foo: true, bar: false, baz: true})\n"
},
{
"path": "packages/pug/test/cases/code.conditionals.html",
"chars": 174,
"preview": "<p>foo</p>\n<p>foo</p>\n<p>foo</p>\n<p>bar</p>\n<p>baz</p>\n<p>bar</p>\n<p>yay</p>\n<div class=\"bar\"></div>\n<div class=\"bar\"></"
},
{
"path": "packages/pug/test/cases/code.conditionals.pug",
"chars": 319,
"preview": "\n- if (true)\n p foo\n- else\n p bar\n\n- if (true) {\n p foo\n- } else {\n p bar\n- }\n\nif true\n p foo\n p bar\n p baz\nelse\n"
},
{
"path": "packages/pug/test/cases/code.escape.html",
"chars": 37,
"preview": "<p><script></p>\n<p><script></p>"
},
{
"path": "packages/pug/test/cases/code.escape.pug",
"chars": 28,
"preview": "p= '<script>'\np!= '<script>'"
},
{
"path": "packages/pug/test/cases/code.html",
"chars": 100,
"preview": "<p></p>\n<p></p>\n<p></p>\n<p>0</p>\n<p>false</p>\n<p></p>\n<p></p>\n<p foo=\"\"></p>\n<p foo=\"0\"></p>\n<p></p>"
},
{
"path": "packages/pug/test/cases/code.iteration.html",
"chars": 449,
"preview": "<ul>\n <li>1</li>\n <li>2</li>\n <li>3</li>\n</ul>\n<ul>\n <li class=\"item-0\">1</li>\n <li class=\"item-1\">2</li>\n <li cla"
},
{
"path": "packages/pug/test/cases/code.iteration.pug",
"chars": 480,
"preview": "\n- var items = [1,2,3]\n\nul\n - items.forEach(function(item){\n li= item\n - })\n\n- var items = [1,2,3]\n\nul\n for item, "
},
{
"path": "packages/pug/test/cases/code.pug",
"chars": 101,
"preview": "p= null\np= undefined\np= ''\np= 0\np= false\np(foo=null)\np(foo=undefined)\np(foo='')\np(foo=0)\np(foo=false)"
},
{
"path": "packages/pug/test/cases/comments-in-case.html",
"chars": 71,
"preview": "<!DOCTYPE html>\n<html>\n <body>\n <p>It's this!</p>\n </body>\n</html>"
},
{
"path": "packages/pug/test/cases/comments-in-case.pug",
"chars": 145,
"preview": "doctype html\nhtml\n body\n - var s = 'this'\n case s\n //- Comment\n when 'this'\n p It's this!\n when '"
},
{
"path": "packages/pug/test/cases/comments.html",
"chars": 320,
"preview": "\n<!-- foo-->\n<ul>\n <!-- bar-->\n <li>one</li>\n <!-- baz-->\n <li>two</li>\n</ul>\n<!--\nul\n li foo\n\n-->\n<!-- block\n// in"
},
{
"path": "packages/pug/test/cases/comments.pug",
"chars": 260,
"preview": "\n// foo\nul\n // bar\n li one\n // baz\n li two\n\n//\n ul\n li foo\n\n// block\n // inline follow\n li three\n\n// block\n /"
},
{
"path": "packages/pug/test/cases/comments.source.html",
"chars": 0,
"preview": ""
},
{
"path": "packages/pug/test/cases/comments.source.pug",
"chars": 97,
"preview": "//-\n s/s.\n\n//- test/cases/comments.source.pug\n\n//-\n test/cases/comments.source.pug\n when\n ()\n"
},
{
"path": "packages/pug/test/cases/doctype.custom.html",
"chars": 23,
"preview": "<!DOCTYPE custom stuff>"
},
{
"path": "packages/pug/test/cases/doctype.custom.pug",
"chars": 20,
"preview": "doctype custom stuff"
},
{
"path": "packages/pug/test/cases/doctype.default.html",
"chars": 68,
"preview": "<!DOCTYPE html>\n<html>\n <body>\n <h1>Title</h1>\n </body>\n</html>"
},
{
"path": "packages/pug/test/cases/doctype.default.pug",
"chars": 32,
"preview": "doctype\nhtml\n body\n h1 Title"
},
{
"path": "packages/pug/test/cases/doctype.keyword.html",
"chars": 15,
"preview": "<!DOCTYPE html>"
},
{
"path": "packages/pug/test/cases/doctype.keyword.pug",
"chars": 12,
"preview": "doctype html"
},
{
"path": "packages/pug/test/cases/each.else.html",
"chars": 203,
"preview": "<ul>\n <li>no users!</li>\n</ul>\n<ul>\n <li>tobi</li>\n <li>loki</li>\n</ul>\n<ul>\n <li>name: tobi</li>\n <li>age: 10</li>"
},
{
"path": "packages/pug/test/cases/each.else.pug",
"chars": 609,
"preview": "\n- var users = []\n\nul\n for user in users\n li= user.name\n else\n li no users!\n\n\n- var users = [{ name: 'tobi', fri"
},
{
"path": "packages/pug/test/cases/escape-chars.html",
"chars": 32,
"preview": "<script>var re = /\\d+/;</script>"
},
{
"path": "packages/pug/test/cases/escape-chars.pug",
"chars": 25,
"preview": "script.\n var re = /\\d+/;"
},
{
"path": "packages/pug/test/cases/escape-test.html",
"chars": 257,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <title>escape-test</title>\n </head>\n <body>\n <textarea><param name="fla"
},
{
"path": "packages/pug/test/cases/escape-test.pug",
"chars": 208,
"preview": "doctype html\nhtml\n head\n title escape-test\n body\n textarea\n - var txt = '<param name=\"fla"
},
{
"path": "packages/pug/test/cases/escaping-class-attribute.html",
"chars": 225,
"preview": "<foo attr=\"<%= bar %>\"></foo>\n<foo class=\"<%= bar %>\"></foo>\n<foo attr=\"<%= bar %>\"></foo>\n<foo class=\"<%= b"
},
{
"path": "packages/pug/test/cases/escaping-class-attribute.pug",
"chars": 176,
"preview": "foo(attr=\"<%= bar %>\")\nfoo(class=\"<%= bar %>\")\nfoo(attr!=\"<%= bar %>\")\nfoo(class!=\"<%= bar %>\")\nfoo(class!=\"<%= bar %> l"
},
{
"path": "packages/pug/test/cases/filter-in-include.html",
"chars": 91,
"preview": "<html>\n <head><style type=\"text/css\">body {\n padding: 15px;\n}\n</style>\n </head>\n</html>\n"
},
{
"path": "packages/pug/test/cases/filter-in-include.pug",
"chars": 42,
"preview": "include ./auxiliary/filter-in-include.pug\n"
},
{
"path": "packages/pug/test/cases/filters-empty.html",
"chars": 68,
"preview": "<fb:users>\n <fb:user age=\"2\"><![CDATA[]]>\n </fb:user>\n</fb:users>\n"
},
{
"path": "packages/pug/test/cases/filters-empty.pug",
"chars": 110,
"preview": "- var users = [{ name: 'tobi', age: 2 }]\n\nfb:users\n for user in users\n fb:user(age=user.age)\n :cdata\n"
},
{
"path": "packages/pug/test/cases/filters.coffeescript.html",
"chars": 135,
"preview": "<script type=\"text/javascript\">\n (function() {\n var regexp;\n\n regexp = /\\n/;\n\n}).call(this);\n (function(){}).call(th"
},
{
"path": "packages/pug/test/cases/filters.coffeescript.pug",
"chars": 146,
"preview": "script(type='text/javascript')\n :coffee-script\n regexp = /\\n/\n :coffee-script(minify=true)\n math =\n square:"
},
{
"path": "packages/pug/test/cases/filters.custom.html",
"chars": 63,
"preview": "\n<html>\n <body>BEGINLine 1\nLine 2\n\nLine 4END\n </body>\n</html>"
},
{
"path": "packages/pug/test/cases/filters.custom.pug",
"chars": 81,
"preview": "html\n body\n :custom(opt='val' num=2)\n Line 1\n Line 2\n\n Line 4\n"
},
{
"path": "packages/pug/test/cases/filters.include.custom.html",
"chars": 144,
"preview": "\n<html>\n <body>\n <pre>BEGINhtml\n body\n pre\n include:custom(opt='val' num=2) filters.include.custom.pug\nEND<"
},
{
"path": "packages/pug/test/cases/filters.include.custom.pug",
"chars": 85,
"preview": "html\n body\n pre\n include:custom(opt='val' num=2) filters.include.custom.pug\n"
},
{
"path": "packages/pug/test/cases/filters.include.html",
"chars": 313,
"preview": "<html>\n <body><p>Just <em>some</em> markdown <strong>tests</strong>.</p>\n<p>With new line.</p>\n\n <script>(function()"
},
{
"path": "packages/pug/test/cases/filters.include.pug",
"chars": 207,
"preview": "html\n body\n include:markdown-it some.md\n script\n include:coffee-script(minify=true) include-filter-coffee.co"
},
{
"path": "packages/pug/test/cases/filters.inline.html",
"chars": 42,
"preview": "\n<p>\n before <![CDATA[inside]]> after</p>"
},
{
"path": "packages/pug/test/cases/filters.inline.pug",
"chars": 31,
"preview": "p before #[:cdata inside] after"
},
{
"path": "packages/pug/test/cases/filters.less.html",
"chars": 90,
"preview": "<html>\n <head><style type=\"text/css\">body {\n padding: 15px;\n}\n</style>\n </head>\n</html>"
},
{
"path": "packages/pug/test/cases/filters.less.pug",
"chars": 121,
"preview": "html\n head\n style(type=\"text/css\")\n :less\n @pad: 15px;\n body {\n padding: @pad;\n }"
},
{
"path": "packages/pug/test/cases/filters.markdown.html",
"chars": 102,
"preview": "<html>\n <body><p>This is <em>some</em> awesome <strong>markdown</strong>\nwhoop.</p>\n </body>\n</html>"
},
{
"path": "packages/pug/test/cases/filters.markdown.pug",
"chars": 81,
"preview": "html\n body\n :markdown\n This is _some_ awesome **markdown**\n whoop.\n"
},
{
"path": "packages/pug/test/cases/filters.nested.html",
"chars": 155,
"preview": "<script><![CDATA[!function(){console.log(\"test\")}();]]></script>\n<script><![CDATA[(function(){!function(){console.log(\"t"
},
{
"path": "packages/pug/test/cases/filters.nested.pug",
"chars": 160,
"preview": "script\n :cdata:uglify-js\n (function() {\n console.log('test')\n })()\nscript\n :cdata:uglify-js:coffee-script\n "
},
{
"path": "packages/pug/test/cases/filters.stylus.html",
"chars": 106,
"preview": "<html>\n <head><style type=\"text/css\">body {\n padding: 50px;\n}\n</style>\n </head>\n <body></body>\n</html>"
},
{
"path": "packages/pug/test/cases/filters.stylus.pug",
"chars": 97,
"preview": "html\n head\n style(type=\"text/css\")\n :stylus\n body\n padding: 50px\n body\n"
},
{
"path": "packages/pug/test/cases/html.html",
"chars": 219,
"preview": "<ul>\n<li>foo</li>\n<li>bar</li>\n<li>baz</li>\n</ul>\n<!--build:js /js/app.min.js?v=1449104952939-->\n<!--endbuild-->\n<p>You "
},
{
"path": "packages/pug/test/cases/html.pug",
"chars": 247,
"preview": "- var version = 1449104952939\n\n<ul>\n <li>foo</li>\n <li>bar</li>\n <li>baz</li>\n</ul>\n\n<!--build:js /js/app.min.js?v=#{"
},
{
"path": "packages/pug/test/cases/html5.html",
"chars": 103,
"preview": "<!DOCTYPE html>\n<input type=\"checkbox\" checked>\n<input type=\"checkbox\" checked>\n<input type=\"checkbox\">"
},
{
"path": "packages/pug/test/cases/html5.pug",
"chars": 119,
"preview": "doctype html\ninput(type='checkbox', checked)\ninput(type='checkbox', checked=true)\ninput(type='checkbox', checked=false)"
},
{
"path": "packages/pug/test/cases/include-extends-from-root.html",
"chars": 105,
"preview": "<html>\n <head>\n <title>My Application</title>\n </head>\n <body>\n <h1>hello</h1>\n </body>\n</html>"
},
{
"path": "packages/pug/test/cases/include-extends-from-root.pug",
"chars": 41,
"preview": "include /auxiliary/extends-from-root.pug\n"
},
{
"path": "packages/pug/test/cases/include-extends-of-common-template.html",
"chars": 34,
"preview": "<div>test1</div>\n<div>test2</div>\n"
},
{
"path": "packages/pug/test/cases/include-extends-of-common-template.pug",
"chars": 88,
"preview": "include auxiliary/extends-empty-block-1.pug\ninclude auxiliary/extends-empty-block-2.pug\n"
},
{
"path": "packages/pug/test/cases/include-extends-relative.html",
"chars": 105,
"preview": "<html>\n <head>\n <title>My Application</title>\n </head>\n <body>\n <h1>hello</h1>\n </body>\n</html>"
},
{
"path": "packages/pug/test/cases/include-extends-relative.pug",
"chars": 48,
"preview": "include ../cases/auxiliary/extends-relative.pug\n"
},
{
"path": "packages/pug/test/cases/include-filter-coffee.coffee",
"chars": 42,
"preview": "math =\n square: (value) -> value * value\n"
},
{
"path": "packages/pug/test/cases/include-only-text-body.html",
"chars": 17,
"preview": "The message is \"\""
}
]
// ... and 712 more files (download for full content)
About this extraction
This page contains the full source code of the pugjs/pug GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 912 files (2.7 MB), approximately 751.6k tokens, and a symbol index with 125 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.