Skip to content

Commit

Permalink
pup: add page (tldr-pages#1533)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrl authored Oct 11, 2017
2 parents a6a29fc + fbf4590 commit 4510294
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pages/common/pup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# pup

> Command line HTML parsing tool.
- Transform a 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 '{{div#id}}'`

- Filter HTML by attribute value:

`cat {{index.html}} | pup '{{input[type="text"]}}'`

- Print all text from the filtered HTML elements and their children:

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

- Print HTML as JSON:

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

0 comments on commit 4510294

Please sign in to comment.