Skip to content

Commit 7558e2e

Browse files
committed
Update README
1 parent 7744d74 commit 7558e2e

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,32 @@ Select unist nodes using css-like selectors.
1111
[david]: https://david-dm.org/eush77/unist-util-select
1212
[david-badge]: https://david-dm.org/eush77/unist-util-select.png
1313

14+
## Example
15+
16+
```js
17+
var select = require('unist-util-select');
18+
19+
select(ast, 'paragraph emphasis > text')
20+
//=> array of nodes
21+
```
22+
23+
## Features
24+
25+
- [x] Type selectors: `paragraph`
26+
- [x] Descendant selectors: `paragraph text`
27+
- [x] Child selectors: `paragraph > text`
28+
- [x] Sibling selectors: `paragraph ~ text`
29+
- [x] Adjacent sibling selectors: `paragraph + text`
30+
- [ ] Attribute selectors: `text[value*="substr"]`
31+
- [ ] Universal selectors: `*`
32+
- [ ] Group selectors: `paragraph, text`
33+
34+
## API
35+
36+
#### `unistUtilSelect(ast, selector)`
37+
38+
Applies `selector` to `ast`, returns array of matching nodes.
39+
1440
## Install
1541

1642
```

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
"url": "https://github.com/eush77/unist-util-select/issues"
1717
},
1818
"keywords": [
19-
"css",
19+
"child",
20+
"descendant",
21+
"sibling",
22+
"type",
2023
"expression",
2124
"mdast",
2225
"node",

0 commit comments

Comments
 (0)