mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-07-01 20:35:26 +02:00
fixup! pup: add page
This commit is contained in:
parent
3dd8f82127
commit
e2f2779c3c
2 changed files with 8 additions and 8 deletions
BIN
pages/common/.pup.md.swp
Normal file
BIN
pages/common/.pup.md.swp
Normal file
Binary file not shown.
|
@ -1,27 +1,27 @@
|
||||||
# pup
|
# 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`
|
`cat {{index.html}} | pup --color`
|
||||||
|
|
||||||
- Filter HTML by element tag name:
|
- Filter HTML by element tag name:
|
||||||
|
|
||||||
`cat {{index.html}} | pup '{{tag}}'`
|
`cat {{index.html}} | pup '{{div}}'`
|
||||||
|
|
||||||
- Filter HTML by id:
|
- Filter HTML by id:
|
||||||
|
|
||||||
`cat {{index.html}} | pup '{{tag#id}}'`
|
`cat {{index.html}} | pup '{{div#id}}'`
|
||||||
|
|
||||||
- Filter HTML by attribute value:
|
- 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:
|
- Print HTML as JSON:
|
||||||
|
|
||||||
`cat {{index.html}} | pup '{{tag}} json{}'`
|
`cat {{index.html}} | pup '{{div}} json{}'`
|
||||||
|
|
Loading…
Add table
Reference in a new issue