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.
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```
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments