Skip to content

Commit

Permalink
fixup! pup: add page
Browse files Browse the repository at this point in the history
  • Loading branch information
deekim committed Oct 10, 2017
1 parent 3dd8f82 commit e2f2779
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Binary file added pages/common/.pup.md.swp
Binary file not shown.
16 changes: 8 additions & 8 deletions pages/common/pup.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# pup

> HTML parsing tool.
> Command line HTML parsing tool.
- Transform raw HTML file into a cleaned, indented, and colored format:
- 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}}'`
`cat {{index.html}} | pup '{{div}}'`

- Filter HTML by id:

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

- Filter HTML by attribute value:

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

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

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

- Print HTML as JSON:

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

0 comments on commit e2f2779

Please sign in to comment.