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.