Skip to content

Commit 2580315

Browse files
committed
Refactor prose
1 parent 237b26a commit 2580315

File tree

1 file changed

+43
-27
lines changed

1 file changed

+43
-27
lines changed

readme.md

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

11-
Remove [`position`][position]s from a [Unist][] tree.
11+
[**unist**][unist] utility to remove [`position`][position]s from tree.
1212

13-
## Installation
13+
## Install
1414

1515
[npm][]:
1616

17-
```bash
17+
```sh
1818
npm install unist-util-remove-position
1919
```
2020

2121
## Usage
2222

23-
```javascript
23+
```js
2424
var remark = require('remark')
2525
var removePosition = require('unist-util-remove-position')
2626

2727
var tree = remark().parse('Some _emphasis_, **importance**, and `code`.')
2828

29-
console.dir(removePosition(tree, true), {depth: null})
29+
removePosition(tree, true)
30+
31+
console.dir(tree, {depth: null})
3032
```
3133

3234
Yields:
3335

3436
```js
35-
{ type: 'root',
36-
children:
37-
[ { type: 'paragraph',
38-
children:
39-
[ { type: 'text', value: 'Some ' },
40-
{ type: 'emphasis',
41-
children: [ { type: 'text', value: 'emphasis' } ] },
42-
{ type: 'text', value: ', ' },
43-
{ type: 'strong',
44-
children: [ { type: 'text', value: 'importance' } ] },
45-
{ type: 'text', value: ', and ' },
46-
{ type: 'inlineCode', value: 'code' },
47-
{ type: 'text', value: '.' } ] } ] }
37+
{
38+
type: 'root',
39+
children: [
40+
{
41+
type: 'paragraph',
42+
children: [
43+
{ type: 'text', value: 'Some ' },
44+
{
45+
type: 'emphasis',
46+
children: [ { type: 'text', value: 'emphasis' } ]
47+
},
48+
{ type: 'text', value: ', ' },
49+
{
50+
type: 'strong',
51+
children: [ { type: 'text', value: 'importance' } ]
52+
},
53+
{ type: 'text', value: ', and ' },
54+
{ type: 'inlineCode', value: 'code' },
55+
{ type: 'text', value: '.' }
56+
]
57+
}
58+
]
59+
}
4860
```
4961

5062
## API
5163

5264
### `removePosition(node[, force])`
5365

54-
Remove [`position`][position]s from [`node`][node]. If `force` is given,
55-
uses `delete`, otherwise, sets `position`s to `undefined`.
66+
Remove [`position`][position]s from [`node`][node].
67+
If `force` is given, uses `delete`, otherwise, sets `position`s to `undefined`.
5668

5769
###### Returns
5870

5971
The given `node`.
6072

6173
## Contribute
6274

63-
See [`contributing.md` in `syntax-tree/unist`][contributing] for ways to get
75+
See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
6476
started.
77+
See [`support.md`][support] for ways to get help.
6578

66-
This organisation has a [Code of Conduct][coc]. By interacting with this
67-
repository, organisation, or community you agree to abide by its terms.
79+
This project has a [Code of Conduct][coc].
80+
By interacting with this repository, organisation, or community you agree to
81+
abide by its terms.
6882

6983
## License
7084

@@ -104,12 +118,14 @@ repository, organisation, or community you agree to abide by its terms.
104118

105119
[author]: https://wooorm.com
106120

121+
[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md
122+
123+
[support]: https://github.com/syntax-tree/.github/blob/master/support.md
124+
125+
[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
126+
107127
[unist]: https://github.com/syntax-tree/unist
108128

109129
[position]: https://github.com/syntax-tree/unist#position
110130

111131
[node]: https://github.com/syntax-tree/unist#node
112-
113-
[contributing]: https://github.com/syntax-tree/unist/blob/master/contributing.md
114-
115-
[coc]: https://github.com/syntax-tree/unist/blob/master/code-of-conduct.md

0 commit comments

Comments
 (0)