{"id":13991605,"url":"https://github.com/izolate/html2pug","last_synced_at":"2025-04-05T22:05:01.481Z","repository":{"id":48034768,"uuid":"51851202","full_name":"izolate/html2pug","owner":"izolate","description":"Converts HTML to Pug :dog:","archived":false,"fork":false,"pushed_at":"2023-04-01T02:28:06.000Z","size":596,"stargazers_count":150,"open_issues_count":19,"forks_count":42,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-29T21:04:11.375Z","etag":null,"topics":["converter","html","parser","pug","pug-template-engine"],"latest_commit_sha":null,"homepage":"https://html2pug.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/izolate.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-16T16:36:23.000Z","updated_at":"2025-03-20T13:08:29.000Z","dependencies_parsed_at":"2024-06-18T13:52:55.797Z","dependency_job_id":"27486d69-2b72-430e-be4f-2e9b581c2ad2","html_url":"https://github.com/izolate/html2pug","commit_stats":{"total_commits":84,"total_committers":3,"mean_commits":28.0,"dds":0.1071428571428571,"last_synced_commit":"434a18a852d6a235f71e89469cf1dcc1b151457e"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izolate%2Fhtml2pug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izolate%2Fhtml2pug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izolate%2Fhtml2pug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izolate%2Fhtml2pug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/izolate","download_url":"https://codeload.github.com/izolate/html2pug/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406085,"owners_count":20933803,"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":["converter","html","parser","pug","pug-template-engine"],"created_at":"2024-08-09T14:01:28.997Z","updated_at":"2025-04-05T22:05:01.453Z","avatar_url":"https://github.com/izolate.png","language":"JavaScript","readme":"# html2pug [![Build Status](https://travis-ci.org/izolate/html2pug.svg?branch=master)](https://travis-ci.org/izolate/html2pug)\n\nConverts **HTML** to **Pug** templating language (_formerly Jade_).  \nRequires Node.js version `7.6` or higher.\n\nTurns this :unamused:\n```html\n\u003c!doctype html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eHello World!\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv id=\"content\"\u003e\n      \u003ch1 class=\"title\"\u003eHello World!\u003c/h1\u003e\n    \u003c/div\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nInto this :tada:\n```pug\ndoctype html\nhtml(lang='en')\n  head\n    title Hello World!\n   body\n    #content\n      h1.title Hello World!\n```\n\n## Install\n\nGet it on [npm](https://www.npmjs.com/package/html2pug):\n\n```bash\nnpm install -g html2pug\n```\n\n## Usage\n\n### CLI\nAccept input from a file or stdin and write to stdout:\n\n```bash\n# choose a file\nhtml2pug \u003c example.html\n\n# use pipe\necho '\u003ch1\u003efoo\u003c/h1\u003e' | html2pug -f\n```\n\nWrite output to a file:\n```bash\nhtml2pug \u003c example.html \u003e example.pug\n```\n\nSee `html2pug --help` for more information.\n\n### Programmatically\n\n```js\nconst html2pug = require('html2pug')\n\nconst html = '\u003cheader\u003e\u003ch1 class=\"title\"\u003eHello World!\u003c/h1\u003e\u003c/header\u003e'\nconst pug = html2pug(html, { tabs: true })\n```\n\n### Options\n\nName | Type | Default | Description\n--- | --- | --- | ---\n`tabs` | `Boolean` | `false` | Use tabs instead of spaces for indentation\n`commas` | `Boolean` | `true` | Use commas to separate node attributes\n`doubleQuotes` | `Boolean` | `false` | Use double quotes instead of single quotes for attribute values\n`fragment` | `Boolean` | `false` | Wraps result in enclosing `\u003chtml\u003e` and `\u003cbody\u003e` tags if false\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizolate%2Fhtml2pug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fizolate%2Fhtml2pug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizolate%2Fhtml2pug/lists"}