2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-17 09:25:32 +00:00
cheat.sheets/sheets/pup
2020-10-20 23:26:55 +01:00

21 lines
501 B
Plaintext

# pup
#
# Command line too for processing HTML
# Reading from stdin, pup prints to stdout, allowing the user to filter parts
# of the page using CSS selectors.
# Install pup. Requires `go`.
go install github.com/ericchiang/pup
# Indent and colorize HTML.
cat file.html | pup --color
# Filter by tag.
cat file.html | pup 'title'
# Pseudoclass: filter by content "History".
cat file.html | pup ':contains("History")'
# Multiple groups of selectors.
cat file.html | pup 'title, h1 span[dir="auto"]'