1.0.0 • Published 8 years ago

html v1.0.0

Weekly downloads
143,456
License
BSD
Repository
github
Last release
8 years ago

html prettyprinter

A node port of beautify-html.js by Nochum Sossonko which is based on jsbeautifier by Einar Lielmanis

Installation

from npm (node package manager)

  npm install html

Usage (command line)

  echo "<h2><strong><a href="http://awesome.com">AwesomeCom</a></strong><span>is awesome</span></h2>" | html

returns:

  <h2>
      <strong>
          <a href=http://awesome.com>AwesomeCom</a>
      </strong>
      <span>
          is awesome
      </span>
  </h2>

html foo.html will write the prettified version to stdout.

html *.html will update in place all matching html files with their prettified versions.

Advanced usage

I find myself constantly using the 'Copy as HTML' feature of the Chrome Inspector:

Copy as HTML

The downside is that that usually the HTML that gets copied is pretty ugly:

Before pretty printing

On OS X you can use pbpaste and pbcopy to stream your clipboard in and out of unix pipes. With the ugly HTML still in your clipboard run this command:

pbpaste | html | pbcopy

Now when you paste your clipboard into an editor you will get nice, pretty printed HTML:

After pretty printing

Upgrading

grab the newest beautify-html.js from js-beautifier and drop it into lib/ as html.js. then add the following code to the bottom of html.js:

  module.exports = { prettyPrint: style_html }

BSD LICENSE

@homeboxio/dreddtestdrived3lab3akibardinlab3kibardinethereum-sourcifyreact-render-static-cliperfecto-ai-reportsprosemirror-otl-dev-toolssxyj-taro-transformer-wxyoutubex@atlastix/euiethereum-sourcify-climarko-brunch@everything-registry/sub-chunk-1867@kalopilato/hackmyresumepsychic-octo-robotproof-sdk@lgs-innovations/node-onvifsimple-spa-crawler@redsift/tape-reel@rtarojs/taroize@rtarojs/transformer-wx@passmarked/seosimple-appsilvvrsassdoc-theme-hermansassdoc-theme-pixuxjadexplainroderic@namics/nitro-component-catalog@namics/nitro-frontify-deployerralio@mini_program/cli@jspatrick/beautifyprettypreregex-viewerprosemirror-dev-toolkitprosemirror-dev-toolsprosemirror-second-dev-toolssepet@remirror/react-debuggershayder-pacshinobi-onvifwebglstarterkitspformstext-aid-too@yeanzhi/transformer-wxreport-generatorwxmp-transformer-jsx@tarojs/taroize@tarojs/transformer-wxtemplates-parserteal-generatoryouseeu@soulsnatcherr/express-otomatik-yonlendirmetarojs-transformer-ali-s4stemporefugittesterantosutestfromlitesteui-forkexpress-angular-starterexp-react-testexpress-otomatik-yonlendirmeeditoaddredddredd-benchdredd-extendeddredd-proxy-enableddredd-using-gavel-and-chai-assertionsfractal-react-adapterfile-queryfmlfluentcvflightworker-scriptgitbook-plugin-json-schemagitbook-plugin-prettify-htmldp-taro-taroizedp-taro-transformer-wxdmg-dreddlookout-chai-enzymedexscraplive-chat-for-crmd-engraver-blockchain-server-nodedormdot-emcm-phcadeauinfocollectorchangba-componentnerv-to-mp@evkj/x-site-rendernew-html@figmania/uimegadoc-test-utilsmdtkmarkup-itmarquee-static-sdkmilomimosa-server-template-compile
1.0.0

8 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.7

11 years ago

0.0.6

12 years ago

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

13 years ago