HTML pretty printer.
A node port of beautify-html.js by Nochum Sossonko which is based on jsbeautifier by Einar Lielmanis
npm install html
echo "<h2><strong><a href="">AwesomeCom</a></strong><span>is awesome</span></h2>" | html
html foo.html will write the prettified version to
html *.html will update in place all matching html files with their prettified versions.
I find myself constantly using the 'Copy as HTML' feature of the Chrome Inspector:
The downside is that that usually the HTML that gets copied is pretty ugly:
On OS X you can use
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:
grab the newest
beautify-html.js from js-beautifier and drop it into
html.js. then add the following code to the bottom of
moduleexports = prettyPrint: style_html