File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,32 @@ Select unist nodes using css-like selectors.
11
11
[ david ] : https://david-dm.org/eush77/unist-util-select
12
12
[ david-badge ] : https://david-dm.org/eush77/unist-util-select.png
13
13
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
+
14
40
## Install
15
41
16
42
```
Original file line number Diff line number Diff line change 16
16
"url" : " https://github.com/eush77/unist-util-select/issues"
17
17
},
18
18
"keywords" : [
19
- " css" ,
19
+ " child" ,
20
+ " descendant" ,
21
+ " sibling" ,
22
+ " type" ,
20
23
" expression" ,
21
24
" mdast" ,
22
25
" node" ,
You can’t perform that action at this time.
0 commit comments