Skip to content

Commit 4e5a749

Browse files
committed
Refactor prose
1 parent 27ca2ce commit 4e5a749

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

readme.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
[![Backers][backers-badge]][collective]
99
[![Chat][chat-badge]][chat]
1010

11-
Selector support for [unist][].
12-
`querySelector`, `querySelectorAll`, and `matches`.
11+
[**unist**][unist] utility with equivalents `querySelector`, `querySelectorAll`,
12+
and `matches`.
1313

1414
Note that the DOM has references to their parent nodes, meaning that
1515
`document.body.matches(':last-child')` can be evaluated.
1616
This information is not stored in unist, so selectors like that don’t work.
1717

1818
[View the list of supported selectors »][support]
1919

20-
## Installation
20+
## Install
2121

2222
[npm][]:
2323

24-
```bash
24+
```sh
2525
npm install unist-util-select
2626
```
2727

@@ -35,13 +35,13 @@ Returns `boolean`, whether the node matches or not.
3535
This only checks the element itself, not the surrounding tree.
3636
Thus, nesting in selectors is not supported (`paragraph strong`,
3737
`paragraph > strong`), nor are selectors like `:first-child`, etc.
38-
This simply checks that the given element matches the selector.
38+
This only checks that the given element matches the selector.
3939

40-
```javascript
40+
```js
4141
var u = require('unist-builder')
4242
var matches = require('unist-util-select').matches
4343

44-
matches('strong, em', u('strong', [u('text', 'bold')])) // => true
44+
matches('strong, em', u('strong', [u('text', 'important')])) // => true
4545
matches('[lang]', u('code', {lang: 'js'}, 'console.log(1)')) // => true
4646
```
4747

@@ -51,7 +51,7 @@ Select the first node matching `selector` in the given `tree` (could be the
5151
tree itself).
5252
Returns the found [node][], if any.
5353

54-
```javascript
54+
```js
5555
var u = require('unist-builder')
5656
var select = require('unist-util-select').select
5757

@@ -71,7 +71,7 @@ console.log(
7171

7272
Yields:
7373

74-
```javascript
74+
```js
7575
{ type: 'paragraph',
7676
children: [ { type: 'text', value: 'Delta' } ] }
7777
```
@@ -82,7 +82,7 @@ Select all nodes matching `selector` in the given `tree` (could include the
8282
tree itself).
8383
Returns all found [node][]s, if any.
8484

85-
```javascript
85+
```js
8686
var u = require('unist-builder')
8787
var selectAll = require('unist-util-select').selectAll
8888

@@ -104,7 +104,7 @@ console.log(
104104

105105
Yields:
106106

107-
```javascript
107+
```js
108108
[ { type: 'paragraph',
109109
children: [ { type: 'text', value: 'Delta' } ] },
110110
{ type: 'paragraph',
@@ -113,8 +113,6 @@ Yields:
113113

114114
## Support
115115

116-
<!--lint ignore no-html-->
117-
118116
* [x] `*` (universal selector)
119117
* [x] `,` (multiple selector)
120118
* [x] `paragraph` (type selector)
@@ -158,11 +156,13 @@ Yields:
158156

159157
## Contribute
160158

161-
See [`contributing.md` in `syntax-tree/unist`][contributing] for ways to get
159+
See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
162160
started.
161+
See [`support.md`][help] for ways to get help.
163162

164-
This organisation has a [Code of Conduct][coc]. By interacting with this
165-
repository, organisation, or community you agree to abide by its terms.
163+
This project has a [Code of Conduct][coc].
164+
By interacting with this repository, organisation, or community you agree to
165+
abide by its terms.
166166

167167
## License
168168

@@ -200,12 +200,14 @@ repository, organisation, or community you agree to abide by its terms.
200200

201201
[license]: license
202202

203+
[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md
204+
205+
[help]: https://github.com/syntax-tree/.github/blob/master/support.md
206+
207+
[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
208+
203209
[unist]: https://github.com/syntax-tree/unist
204210

205211
[node]: https://github.com/syntax-tree/unist#node
206212

207213
[support]: #support
208-
209-
[contributing]: https://github.com/syntax-tree/unist/blob/master/contributing.md
210-
211-
[coc]: https://github.com/syntax-tree/unist/blob/master/code-of-conduct.md

0 commit comments

Comments
 (0)