Update cheatsheets

This commit is contained in:
ivuorinen
2025-12-02 00:21:15 +00:00
parent fde4de0db5
commit 922b1aa234
102 changed files with 288 additions and 216 deletions

View File

@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# htmlq
> Use CSS selectors to extract content from HTML files.
> More information: <https://github.com/mgdm/htmlq>.
> More information: <https://github.com/mgdm/htmlq#usage>.
- Return all elements of class `card`:
@@ -14,16 +14,16 @@ source: https://github.com/tldr-pages/tldr.git
- Get the text content of the first paragraph:
`cat {{path/to/file.html}} | htmlq --text 'p:first-of-type'`
`cat {{path/to/file.html}} | htmlq {{[-t|--text]}} 'p:first-of-type'`
- Find all the links in a page:
`cat {{path/to/file.html}} | htmlq --attribute href 'a'`
`cat {{path/to/file.html}} | htmlq {{[-a|--attribute]}} href 'a'`
- Remove all images and SVGs from a page:
`cat {{path/to/file.html}} | htmlq --remove-nodes 'img' --remove-nodes 'svg'`
`cat {{path/to/file.html}} | htmlq {{[-r|--remove-nodes]}} 'img' {{[-r|--remove-nodes]}} 'svg'`
- Pretty print and write the output to a file:
`htmlq --pretty --filename {{path/to/input.html}} --output {{path/to/output.html}}`
`htmlq {{[-p|--pretty]}} {{[-f|--filename]}} {{path/to/input.html}} {{[-o|--output]}} {{path/to/output.html}}`