diff --git a/pages/common/.pup.md.swp b/pages/common/.pup.md.swp new file mode 100644 index 000000000..4427c795a Binary files /dev/null and b/pages/common/.pup.md.swp differ diff --git a/pages/common/pup.md b/pages/common/pup.md index 593ecb5d1..a9fd3f5f6 100644 --- a/pages/common/pup.md +++ b/pages/common/pup.md @@ -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{}'`