{"id":16881550,"url":"https://github.com/benbjohnson/httpng","last_synced_at":"2025-10-04T02:45:53.417Z","repository":{"id":2727750,"uuid":"3722814","full_name":"benbjohnson/httpng","owner":"benbjohnson","description":"A local server for saving HTML elements as PNG files.","archived":false,"fork":false,"pushed_at":"2012-05-18T14:50:54.000Z","size":128,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-29T18:50:49.114Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benbjohnson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-14T21:57:56.000Z","updated_at":"2017-05-21T03:15:52.000Z","dependencies_parsed_at":"2022-08-25T14:10:13.308Z","dependency_job_id":null,"html_url":"https://github.com/benbjohnson/httpng","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/benbjohnson/httpng","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbjohnson%2Fhttpng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbjohnson%2Fhttpng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbjohnson%2Fhttpng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbjohnson%2Fhttpng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benbjohnson","download_url":"https://codeload.github.com/benbjohnson/httpng/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbjohnson%2Fhttpng/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278256802,"owners_count":25957089,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-13T16:03:28.862Z","updated_at":"2025-10-04T02:45:53.397Z","avatar_url":"https://github.com/benbjohnson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"httpng - A local server for snapshotting HTML elements\n======================================================\n\n## DESCRIPTION\n\nHttpng is a local server that you can run if you want to use HTML5 \u0026 CSS3 to\ndesign but you want to export the page elements as PNGs. The server uses the\n[html2canvas]([http://html2canvas.hertzen.com/]) library to render the elements\non the screen. Please see the limitations section of this README for more\ninformation about what can and cannot be rendered.\n\nHttpng follows the rules of [Semantic Versioning](http://semver.org/).\n\n\n## INSTALLATION\n\nYou can install httpng with RubyGems:\n\n    $ gem install httpng\n\n\n## RUNNING\n\nTo run httpng, simply change directories to where your HTML file resides and\nrun the following command:\n\n    $ httpng\n\nThis will run a web server at `localhost:7020`. You can change the port\nby setting the `--port` or `-p` option on the command line. When opening the\nweb page in your browser, be sure to add the file name after the host and port.\nFor example, if your file name is `my_page.html` then open up\n`http://localhost:7020/my_page.html` and not just `http://localhost:7020/`.\n\n\n## EXPORTING\n\nThe server automatically inserts the JavaScript tags required for httpng to work\nso just make sure your file includes `\u003cHTML\u003e` or `\u003cHEAD\u003e` and the file extension\nis `html`.\n\nWhen you load your page then you should see a bar at the top that gives you a\nbutton to export your images.\n\nTo mark HTML elements for export, simply add a `data-export=\"\u003cname\u003e\"` tag to the\nelement like this:\n\n    \u003cdiv style=\"border:1px solid black;\" data-export=\"my_file\"\u003e\n      \u003c!-- More code here... --\u003e\n    \u003c/div\u003e\n\nWhen you export your images, this `DIV` will be exported as `my_file.png` in\nyour output directory.\n\n\n## Output Directory\n\nBy default, `httpng` will export your files to the `httpng-output/` directory\nrelative to when you started the command from. To change the output directory,\nsimply use the `--output` or `-o` arguments on the command line:\n\n    $ httpng -o /path/to/my_output_dir\n\n\n## Limitations\n\nThere are a few limitations with HTTPNG:\n\n1. Text directly in the exported element will not render. For example, placing\n   text in a DIV (`\u003cdiv\u003efoo\u003c/div\u003e`) will not render but putting the text in a\n   span or p will work: `\u003cdiv\u003e\u003cspan\u003efoo\u003c/span\u003e\u003c/div\u003e`\n\n1. Any limitation of the html2canvas library:\n   [http://html2canvas.hertzen.com/](http://html2canvas.hertzen.com/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenbjohnson%2Fhttpng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenbjohnson%2Fhttpng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenbjohnson%2Fhttpng/lists"}