From 5c76aeeba9152e72b70e2ef4d169b13260a48be7 Mon Sep 17 00:00:00 2001 From: Eric Chiang Date: Wed, 17 Sep 2014 21:50:06 -0400 Subject: [PATCH] Update README.md --- README.md | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1f0b5ad..91b112b 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,36 @@ $ pup < robots.html table -l 2 ``` +####Slices + +Slices allow you to do simple `{start:end:by}` operations to limit the number of nodes +selected for the next round of selection. + +Provide one number for a simple index. + +```bash +$ pup < robots.html a {0} + + +``` + +You can provide an end to limit the number of nodes selected. + +```bash +$ # {:3} is the same as {0:3} +$ pup < robots.html a {:3} + + + + navigation + + + search + +``` + +The `by` index still needs work. + ## Implemented Selectors For further examples of these selectors head over to [w3schools]( @@ -161,8 +191,6 @@ cat index.html | pup element#id[attribute=value] Non-HTML selectors which effect the output type are implemented as functions which can be provided as a final argument. -As of now, `text{}` is the only implemented function. - #### `text{}` Print all text from selected nodes and children in depth first order.