{"id":13552788,"url":"https://github.com/donpark/html2jade","last_synced_at":"2025-05-15T09:07:35.499Z","repository":{"id":57267846,"uuid":"1653808","full_name":"donpark/html2jade","owner":"donpark","description":"Converts HTML to Jade template. Not perfect but useful enough for non-daily conversions.","archived":false,"fork":false,"pushed_at":"2017-04-24T04:35:25.000Z","size":188,"stargazers_count":1172,"open_issues_count":19,"forks_count":155,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-05-06T03:03:46.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","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/donpark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-04-23T15:12:44.000Z","updated_at":"2025-04-09T14:24:48.000Z","dependencies_parsed_at":"2022-09-02T05:41:02.083Z","dependency_job_id":null,"html_url":"https://github.com/donpark/html2jade","commit_stats":null,"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donpark%2Fhtml2jade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donpark%2Fhtml2jade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donpark%2Fhtml2jade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donpark%2Fhtml2jade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/donpark","download_url":"https://codeload.github.com/donpark/html2jade/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310515,"owners_count":22049469,"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-08-01T12:02:10.241Z","updated_at":"2025-05-15T09:07:30.482Z","avatar_url":"https://github.com/donpark.png","language":"HTML","readme":"# html2jade #\n[![Build Status](https://travis-ci.org/donpark/html2jade.png?branch=master)](https://travis-ci.org/donpark/html2jade)\n\n`html2jade` converts HTML into [Jade](https://github.com/visionmedia/jade) format.\n\nThis module is now maintained by [@aichholzer](https://github.com/aichholzer)\n\n\n## Status ##\n\nMostly usable but sometimes requires fixing up, usually involving conditionals and scripts indentation.\n\nWhile converting a fairly complicated theme package with ~20 HTML files, I had to hand-edit just twice.\n\nCompatible with Node.js 4.0+ (verified with v4.2.4) but likely **NOT** with Node.js 0.11.x, 0.12.x, and io.js.\n\n\n## Requirements\n\n`html2jade` version prior to 0.7 support OS X and Linux only.\n\n`html2jade` version 0.7+ should support OS X, Windows, and Linux.\n\n## Install ##\n\n    npm install -g html2jade\n\n## Command-line Usage ##\n\nOutputs to stdout if input is URL\n\n    html2jade http://twitter.com\n\n    html2jade http://twitter.com \u003e twitter.jade\n\nOutputs to file if input is file\n\n    html2jade mywebpage.html # outputs mywebpage.jade\n    html2jade public/*.html  # converts all .html files to .jade\n\nConvert HTML from `stdin`\n\n    cat mywebpage.html | html2jade -\n\nTo generate [Scalate](http://scalate.fusesource.org/) compatible output:\n\n    html2jade --scalate http://twitter.com\n    html2jade --scalate http://twitter.com \u003e twitter.jade\n    html2jade --scalate mywebpage.html\n    html2jade --scalate public/*.html\n\n### Command-line Options ###\n\n* `-d, --double` - use double quotes for attributes\n* `-o, --outdir \u003cdir\u003e` - path to output generated jade file(s) to\n* `-n, --nspaces \u003cn\u003e` - the number of spaces to indent generated files with. Default is 2 spaces\n* `-t, --tabs` - use tabs instead of spaces\n* `--donotencode` - do not html encode characters. This is useful for template files which may contain expressions like {{username}}\n* `--bodyless` - do not output enveloping html and body tags\n* `--numeric` - use numeric character entities\n* `-s, --scalate` - generate [Scalate](http://scalate.fusesource.org/) variant of jade syntax\n* `--noattrcomma` - omit attribute separating commas\n* `--noemptypipe` - omit lines with only pipe ('|') printable character\n\n## Programmatic Usage (\u003e= 0.0.7)\n\nTo convert raw HTML into Jade:\n\n    var html2jade = require('html2jade');\n    var html = \"\u003chtml\u003e\u003cbody\u003eHello World\u003c/body\u003e\u003c/html\u003e\";\n    html2jade.convertHtml(html, {}, function (err, jade) {\n      // do your thing\n    });\n\nTo convert DOM document into Jade (client-side):\n\n    // assumes html2jade.js file has been loaded\n    Html2Jade.convertDocument(document, {}, function (err, jade) {\n      // do your thing\n    });\n    \n## Converting Mustache/Handlebars Templates\n\nJade is commonly used to generate HTML with embedded Mustache or Handlebars templates.\n\nBe sure to use version 0.8+ if you use template expressions in element IDs or CSS class names\nto avoid generating invalid Jade files.\n\n## Tools using `html2jade` ##\n\n### Web version ###\n\nThere is a [web version](http://html2jade.aaron-powell.com/) of `html2jade`,\nkindly provided by [@aaronpowell](https://github.com/aaronpowell).\n\nPascal Garber's [jade2html2jade](https://github.com/JumpLink/jade2html2jade) does roundtrip from jade to HTML and back. [Online demo](http://jumplink.github.io/jade2html2jade/).\n\n### Linux tray app ###\n\n[Miniclip](http://myguidingstar.github.com/miniclip/) is a Linux tray app that quickly converts\nHTML to Jade, CSS to Stylus and JS to Coffee from clipboard.\n\n## Testing ##\n\nAs of version 0.4, there is a simple unit test that converts HTML files in `test/data` directory\nand compare them against Jade files in the same directory. Unit test harness requires `coffee-script`\nand `mocha` to be installed globally. Run the tests with command `npm test`.\n\n\n## Useful forks ##\n\nIf you're having issues with `br` line-breaks which apparently Jade has some problems with,\ntry [@smaudet](https://github.com/smaudet)'s\n[`fix-breaklines`](https://github.com/smaudet/html2jade/tree/fix-breaklines) branch.\n","funding_links":[],"categories":["Converters","HTML","others"],"sub_categories":["Boilerplates"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonpark%2Fhtml2jade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonpark%2Fhtml2jade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonpark%2Fhtml2jade/lists"}