From f76926abdbd43662814fee95f2e3e28ec37132ad Mon Sep 17 00:00:00 2001 From: deekim Date: Sun, 8 Oct 2017 12:00:15 -0400 Subject: [PATCH 1/7] pup: add page --- pages/common/pup.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pages/common/pup.md diff --git a/pages/common/pup.md b/pages/common/pup.md new file mode 100644 index 00000000000000..56c38853fd500e --- /dev/null +++ b/pages/common/pup.md @@ -0,0 +1,28 @@ +# pup + +> HTML parsing tool. + +- Transform 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}}'` + +- Filter HTML by id: + +`cat {{index.html}} | pup '{{tag#id}}'` + +- Filter HTML by attribute value: + +`cat {{index.html}} | pup '{{tag[attribute="value"}}'` + +- Print all text from selected nodes and children: + +`cat {{index.html}} | pup '{{tag}} text{}` + +- Print HTML as JSON: + +`cat {{index.html}} | pup '{{tag}} json{}'` + From 7ebeed5ca757a72084d9d4ae86ef47bd2a335612 Mon Sep 17 00:00:00 2001 From: deekim Date: Sun, 8 Oct 2017 12:03:16 -0400 Subject: [PATCH 2/7] fixup! pup: add page --- pages/common/pup.md | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/common/pup.md b/pages/common/pup.md index 56c38853fd500e..8c5ba9774c5255 100644 --- a/pages/common/pup.md +++ b/pages/common/pup.md @@ -25,4 +25,3 @@ - Print HTML as JSON: `cat {{index.html}} | pup '{{tag}} json{}'` - From 3dd8f82127ac228d84b511b4013b4e5ee46e8109 Mon Sep 17 00:00:00 2001 From: deekim Date: Sun, 8 Oct 2017 12:13:22 -0400 Subject: [PATCH 3/7] fixup! pup: add page --- pages/common/pup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/pup.md b/pages/common/pup.md index 8c5ba9774c5255..593ecb5d10edf3 100644 --- a/pages/common/pup.md +++ b/pages/common/pup.md @@ -20,7 +20,7 @@ - Print all text from selected nodes and children: -`cat {{index.html}} | pup '{{tag}} text{}` +`cat {{index.html}} | pup '{{tag}} text{}'` - Print HTML as JSON: From e2f2779c3c1e3bc1f32477fb6f85337d14cf725e Mon Sep 17 00:00:00 2001 From: deekim Date: Tue, 10 Oct 2017 19:00:49 -0400 Subject: [PATCH 4/7] fixup! pup: add page --- pages/common/.pup.md.swp | Bin 0 -> 12288 bytes pages/common/pup.md | 16 ++++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 pages/common/.pup.md.swp diff --git a/pages/common/.pup.md.swp b/pages/common/.pup.md.swp new file mode 100644 index 0000000000000000000000000000000000000000..4427c795ae39b7ef81d7a4e12e5389576def3be1 GIT binary patch literal 12288 zcmeI2O=}b}7{^mDdZ~&pco5}rd+5d8tuG)53R;m?tSwjt@v_-Tx*MBGhD^3EtgGG> z^c(5TPvAvQ>L>66C{%p1J029e+a3%5z>iEO$@3(?naeO~&plpTqHB$-g3ECsKCXOy z@@ip6ET0iVN!M66dFmNk6c4KB?XhE0=Zh*}bJK_QvXGf>Myo=zkR4q%GoR<)HH%)+ z$koJH7ytt>uwMhy;>zVqb7|I0?E;-V@o2vRFdhbA00v+H24DaNU;qYS-~bzl#gur- z>pxWO;cQh;{a05_R4@PoFaQHE00S@p126ysFaQHE00RfmfaG88i_=1UV$%Qrzu*7A zjtTLT`NDi=-Z5{PF4JM|F!RiL<{Wc`Im~=ND#SPD1M{AF!@Op0Gq;%2%qiwK=i90B z{z$n|U;qYS00v+H24DaNU;qYS00#DIpfxI)jMVQNr}S2%8*@7t&~xHb)im4hE3?7P zXQg-j!E8&2I;{lbA}y>g-6vVny@$&Wt_#tc93$$j_-_npEv37(7JN>zt7*;HsDoCc z@Y?EJyI7KRDs`JcS=aFSZ|x?fG_L5yr*XT`H)<(GZBVWL?l8kBetVl_jKQ>fQPYOB zJv}Kb+n6zGmsm#aVfrp}tF2O$9da@szmR%8^VWyq(^w7Cm1{oaBq_+v(Z*P#CVonu zZ)R3Yr`1JnE0&qAlFnfS7M-Tb$P2$o^L(5>by?%|C{7_mX 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{}'` From e5bcbfd08173d95dd93248829a6018792efc1952 Mon Sep 17 00:00:00 2001 From: deekim Date: Tue, 10 Oct 2017 19:03:33 -0400 Subject: [PATCH 5/7] fixup! pup: add page --- pages/common/.pup.md.swp | Bin 12288 -> 0 bytes pages/common/pup.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 pages/common/.pup.md.swp diff --git a/pages/common/.pup.md.swp b/pages/common/.pup.md.swp deleted file mode 100644 index 4427c795ae39b7ef81d7a4e12e5389576def3be1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2O=}b}7{^mDdZ~&pco5}rd+5d8tuG)53R;m?tSwjt@v_-Tx*MBGhD^3EtgGG> z^c(5TPvAvQ>L>66C{%p1J029e+a3%5z>iEO$@3(?naeO~&plpTqHB$-g3ECsKCXOy z@@ip6ET0iVN!M66dFmNk6c4KB?XhE0=Zh*}bJK_QvXGf>Myo=zkR4q%GoR<)HH%)+ z$koJH7ytt>uwMhy;>zVqb7|I0?E;-V@o2vRFdhbA00v+H24DaNU;qYS-~bzl#gur- z>pxWO;cQh;{a05_R4@PoFaQHE00S@p126ysFaQHE00RfmfaG88i_=1UV$%Qrzu*7A zjtTLT`NDi=-Z5{PF4JM|F!RiL<{Wc`Im~=ND#SPD1M{AF!@Op0Gq;%2%qiwK=i90B z{z$n|U;qYS00v+H24DaNU;qYS00#DIpfxI)jMVQNr}S2%8*@7t&~xHb)im4hE3?7P zXQg-j!E8&2I;{lbA}y>g-6vVny@$&Wt_#tc93$$j_-_npEv37(7JN>zt7*;HsDoCc z@Y?EJyI7KRDs`JcS=aFSZ|x?fG_L5yr*XT`H)<(GZBVWL?l8kBetVl_jKQ>fQPYOB zJv}Kb+n6zGmsm#aVfrp}tF2O$9da@szmR%8^VWyq(^w7Cm1{oaBq_+v(Z*P#CVonu zZ)R3Yr`1JnE0&qAlFnfS7M-Tb$P2$o^L(5>by?%|C{7_mX Date: Tue, 10 Oct 2017 19:05:27 -0400 Subject: [PATCH 6/7] fixup! pup: add page --- pages/common/pup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/pup.md b/pages/common/pup.md index 446f0168b50903..551fb45dc89b6e 100644 --- a/pages/common/pup.md +++ b/pages/common/pup.md @@ -16,7 +16,7 @@ - Filter HTML by attribute value: -`cat {{index.html}} | pup '{{input[type="text"}}]'` +`cat {{index.html}} | pup '{{input[type="text"]}}'` - Print all text from the filtered HTML elements and their children: From fbf4590e7a46618da1997da5b64e62f8cb1288a9 Mon Sep 17 00:00:00 2001 From: deekim Date: Wed, 11 Oct 2017 08:17:46 -0400 Subject: [PATCH 7/7] fixup! pup: add page --- pages/common/pup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/common/pup.md b/pages/common/pup.md index 551fb45dc89b6e..4b32e85e720f40 100644 --- a/pages/common/pup.md +++ b/pages/common/pup.md @@ -8,7 +8,7 @@ - Filter HTML by element tag name: -`cat {{index.html}} | pup '{{div}}'` +`cat {{index.html}} | pup '{{tag}}'` - Filter HTML by id: