{"id":15619312,"url":"https://github.com/posthtml/posthtml-pug","last_synced_at":"2025-04-28T17:01:21.237Z","repository":{"id":57328837,"uuid":"53024252","full_name":"posthtml/posthtml-pug","owner":"posthtml","description":"Pug Parser","archived":false,"fork":false,"pushed_at":"2018-03-19T09:34:32.000Z","size":36,"stargazers_count":17,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-22T00:27:32.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posthtml.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-03T05:43:23.000Z","updated_at":"2024-06-18T22:21:07.000Z","dependencies_parsed_at":"2022-09-13T05:50:22.937Z","dependency_job_id":null,"html_url":"https://github.com/posthtml/posthtml-pug","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-pug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-pug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-pug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-pug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posthtml","download_url":"https://codeload.github.com/posthtml/posthtml-pug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250969874,"owners_count":21515822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T08:04:59.393Z","updated_at":"2025-04-28T17:01:21.044Z","avatar_url":"https://github.com/posthtml.png","language":"JavaScript","readme":"[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![deps][deps]][deps-url]\n[![tests][tests]][tests-url]\n[![coverage][cover]][cover-url]\n[![code style][style]][style-url]\n[![chat][chat]][chat-badge]\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"200\" height=\"200\" title=\"Pug\" src=\"https://camo.githubusercontent.com/a43de8ca816e78b1c2666f7696f449b2eeddbeca/68747470733a2f2f63646e2e7261776769742e636f6d2f7075676a732f7075672d6c6f676f2f656563343336636565386664396431373236643738333963626539396431663639343639326330632f5356472f7075672d66696e616c2d6c6f676f2d5f2d636f6c6f75722d3132382e737667\"\u003e\n  \u003cimg width=\"220\" height=\"200\" title=\"PostHTML\" hspace=\"20\"     src=\"http://posthtml.github.io/posthtml/logo.svg\"\u003e\n  \u003ch1\u003ePug\u003c/h1\u003e\n  \u003cp\u003eParser for PostHTML\u003c/p\u003e\n\u003c/div\u003e\n\n\u003ch2 align=\"center\"\u003eInstall\u003c/h2\u003e\n\n```bash\nnpm i -D posthtml-pug\n```\n\n\u003ch2 align=\"center\"\u003eUsage\u003c/h2\u003e\n\n```js\nimport { readFileSync } from ('fs')\n\nimport pug from 'posthtml-pug'\nimport posthtml from 'posthtml'\n\nconst file = readFileSync('./index.pug', 'utf8')\n\nposthtml()\n  .process(file, { parser: pug({ locals: {} }) })\n  .then((result) =\u003e console.log(result.html))\n```\n\n\u003ch2 align=\"center\"\u003eOptions\u003c/h2\u003e\n\nSee the [Pug API](https://pugjs.org/api/reference.html) for a full description of the options that can be passed.\nBy default the following options are set:\n\n|Name|Default|\n|:--:|:-----:|\n|**`pretty`**|`true`|\n|**`locals`**|`{}`|\n\n\u003ch2 align=\"center\"\u003eExample\u003c/h2\u003e\n\n**index.pug**\n```pug\ndoctype html\nhtml\n  head\n    meta(charset=\"utf8\")\n    title Pug Parser\n  body\n    h1#title Pug for PostHTML\n    p= greeting\n```\n\n### \u003cimg width=\"80\" height=\"80\" src=\"https://worldvectorlogo.com/logos/nodejs-icon.svg\"\u003e\n\n```js\nimport { readFileSync } from ('fs')\n\nimport pug from 'posthtml-pug'\nimport posthtml from 'posthtml'\n\nconst file = readFileSync('./index.pug', 'utf8')\nconst locals = { greeting: 'Hello!' }\n\nposthtml()\n  .process(file, { parser: pug({ locals: locals }) })\n  .then((result) =\u003e console.log(result.html))\n```\n\n**index.html**\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003ctitle\u003ePug Parser\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003ch1 id=\"title\"\u003ePug for PostHTML\u003c/h1\u003e\n    \u003cp\u003eHello!\u003c/p\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n\u003ch2 align=\"center\"\u003eMaintainer\u003c/h2\u003e\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n   \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003cimg width=\"150 height=\"150\"\n      src=\"https://avatars.githubusercontent.com/u/5419992?v=3\u0026s=150\"\u003e\n      \u003cbr /\u003e\n      \u003ca href=\"https://github.com/michael-ciniawsky\"\u003eMichael Ciniawsky\u003c/a\u003e\n    \u003c/td\u003e\n   \u003c/tr\u003e\n  \u003ctbody\u003e\n\u003c/table\u003e\n\n\u003ch2 align=\"center\"\u003eContributors\u003c/h2\u003e\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n   \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003cimg width=\"150 height=\"150\"\n      src=\"https://avatars.githubusercontent.com/u/556932?v=3\u0026s=150\"\u003e\n      \u003cbr /\u003e\n      \u003ca href=\"https://github.com/jescalan\"\u003eJeff Escalante\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003cimg width=\"150 height=\"150\"\n      src=\"https://avatars.githubusercontent.com/u/1538624?v=3\u0026s=150\"\u003e\n      \u003cbr /\u003e\n      \u003ca href=\"https://github.com/TimothyGu\"\u003eTimothy Gu\u003c/a\u003e\n    \u003c/td\u003e\n   \u003c/tr\u003e\n  \u003ctbody\u003e\n\u003c/table\u003e\n\n[npm]: https://img.shields.io/npm/v/posthtml-pug.svg\n[npm-url]: https://npmjs.com/package/posthtml-pug\n\n[node]: https://img.shields.io/node/v/posthtml-load-options.svg\n[node-url]: https://nodejs.org/\n\n[deps]: https://david-dm.org/posthtml/posthtml-pug.svg\n[deps-url]: https://david-dm.org/posthtml/posthtml-pug\n\n[tests]: http://img.shields.io/travis/posthtml/posthtml-pug.svg\n[tests-url]: https://travis-ci.org/posthtml/posthtml-pug\n\n[cover]: https://coveralls.io/repos/github/posthtml/posthtml-pug/badge.svg?branch=master\n[cover-url]: https://coveralls.io/github/posthtml/posthtml-pug?branch=master\n\n[style]: https://img.shields.io/badge/code%20style-standard-yellow.svg\n[style-url]: http://standardjs.com/\n\n[chat]: https://badges.gitter.im/posthtml/posthtml.svg\n[chat-badge]: https://gitter.im/posthtml/posthtml?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-pug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthtml%2Fposthtml-pug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-pug/lists"}