Skip to content

Commit

Permalink
pup: add page
Browse files Browse the repository at this point in the history
  • Loading branch information
deekim committed Oct 8, 2017
1 parent eae235b commit f76926a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pages/common/pup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# pup

> HTML parsing tool.
- Transform raw HTML file into a cleaned, indented, and colored format:

`cat {{index.html}} | pup --color`

- Filter HTML by element tag name:

`cat {{index.html}} | pup '{{tag}}'`

- Filter HTML by id:

`cat {{index.html}} | pup '{{tag#id}}'`

- Filter HTML by attribute value:

`cat {{index.html}} | pup '{{tag[attribute="value"}}'`

- Print all text from selected nodes and children:

`cat {{index.html}} | pup '{{tag}} text{}`

- Print HTML as JSON:

`cat {{index.html}} | pup '{{tag}} json{}'`

0 comments on commit f76926a

Please sign in to comment.