1.0.0 • Published 9 years ago

html v1.0.0

Weekly downloads
143,456
License
BSD
Repository
github
Last release
9 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-1867tarojs-transformer-ali-s4stemporefugittemplates-parserweb-components-inspectorwxmp-transformer-jsxxjadeteal-generatorspformstesterantosutestfromlitesttext-aid-too@rtarojs/taroize@rtarojs/transformer-wxchangba-componentjade-to-jsxjest-serializer-html-stringjstransformer-htmljsml-davidystephensonjangularkibardinlb3super-html-compilertrtdtollan-client@aminohealth/fractal-react-adapter@aquestsrl/dev-utils@agreejs/agreeize@allenluce/chai-enzyme@axdraft/prosemirror-dev-toolkit@chazzz/simple-docyouseeuxplainwebglstarterkitviewsaurusviewsaurus-ringcentraltsgcoderuxhub12cli@dymp/dylphinize@gtarojs/taroize@harrysong/taroize@figmania/ui@flatfishjs/reactize@lgs-innovations/node-onvif@namics/nitro-component-catalog@namics/nitro-frontify-deployer@evkj/x-site-render@eymail/builder@mini_program/cli@kalopilato/hackmyresume@jspatrick/beautify@redsift/tape-reel@pnnh/atom-react@pnnh/polaris-business@pnnh/venus-business@passmarked/seo@remirror/react-debuggermvss-scriptmilomimosa-server-template-compilenadesiko3open-source-chatonvif-jspaper-cranes-audiopaper-cranes-aufiopandorajssepetrodericsassdoc-theme-hermansassdoc-theme-pixuregex-viewerprosemirror-second-dev-toolsprosemirror-dev-toolkitprosemirror-dev-toolsproof-sdknerv-to-mpnew-htmlnikitichevskiynodejs_toan_eosnodejs_toan_eos1node-onvifnode-onvif-forkednode-onvif-nvrnode-onvif-tsnode-onvif-ts-extendednode-todo-apinode-spritegeneratornotitcia
1.0.0

9 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.7

13 years ago

0.0.6

13 years ago

0.0.5

13 years ago

0.0.4

13 years ago

0.0.3

13 years ago

0.0.2

13 years ago

0.0.1

14 years ago