mirror of
https://github.com/abrendan/MicDropMessages.git
synced 2025-08-25 22:12:02 +02:00
Initial commit
This commit is contained in:
61
node_modules/html/readme.md
generated
vendored
Normal file
61
node_modules/html/readme.md
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
# 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)
|
||||
``` bash
|
||||
npm install html
|
||||
```
|
||||
|
||||
## Usage (command line)
|
||||
|
||||
```
|
||||
echo "<h2><strong><a href="http://awesome.com">AwesomeCom</a></strong><span>is awesome</span></h2>" | html
|
||||
```
|
||||
|
||||
returns:
|
||||
|
||||
``` html
|
||||
<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:
|
||||
|
||||

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

|
||||
|
||||
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:
|
||||
|
||||

|
||||
|
||||
## Upgrading
|
||||
|
||||
grab the newest `beautify-html.js` from [js-beautifier](https://github.com/einars/js-beautify) and drop it into `lib/` as `html.js`. then add the following code to the bottom of `html.js`:
|
||||
|
||||
```javascript
|
||||
module.exports = { prettyPrint: style_html }
|
||||
```
|
||||
|
||||
BSD LICENSE
|
Reference in New Issue
Block a user