Skip to content

Commit b2959da

Browse files
committed
Refactor readme.md
1 parent d9e63b4 commit b2959da

File tree

2 files changed

+77
-28
lines changed

2 files changed

+77
-28
lines changed

package.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@
3030
},
3131
"devDependencies": {
3232
"prettier": "^1.14.2",
33+
"remark-cli": "^5.0.0",
34+
"remark-preset-wooorm": "^4.0.0",
3335
"tape": "^4.2.0",
3436
"xo": "^0.22.0"
3537
},
3638
"scripts": {
37-
"format": "prettier --write '**/*.js' && xo --fix",
39+
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
3840
"test": "node test"
3941
},
4042
"prettier": {
@@ -48,5 +50,10 @@
4850
"xo": {
4951
"prettier": true,
5052
"esnext": false
53+
},
54+
"remarkConfig": {
55+
"plugins": [
56+
"preset-wooorm"
57+
]
5158
}
5259
}

readme.md

+69-27
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
[![npm](https://nodei.co/npm/unist-builder.png)](https://npmjs.com/package/unist-builder)
1+
# unist-builder [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]
22

3-
# unist-builder
3+
Helper for creating [**unist**][unist] trees with [hyperscript][]-like syntax.
44

5-
[![Build Status][travis-badge]][travis] [![Dependency Status][david-badge]][david]
5+
## Installation
66

7-
Helper for creating [unist][] trees with [hyperscript][]-like syntax.
7+
[npm][]:
88

9-
[unist]: https://github.com/wooorm/unist
10-
[hyperscript]: https://github.com/dominictarr/hyperscript
11-
12-
[travis]: https://travis-ci.org/eush77/unist-builder
13-
[travis-badge]: https://travis-ci.org/eush77/unist-builder.svg?branch=master
14-
[david]: https://david-dm.org/eush77/unist-builder
15-
[david-badge]: https://david-dm.org/eush77/unist-builder.png
9+
```bash
10+
npm install unist-builder
11+
```
1612

17-
## Example
13+
## Usage
1814

1915
```js
2016
var u = require('unist-builder')
@@ -57,28 +53,74 @@ results in the following tree:
5753

5854
## API
5955

60-
#### `u(type, [props], [value])`
56+
### `u(type[, props][, children|value])`
6157

62-
`type`: `String`<br>
63-
`props`: `Object`<br>
64-
`value`: `String`<br>
58+
Creates a node from `props`, `children`, and optionally `value`.
6559

66-
Creates a node from `props` and optional `value`.
60+
###### Signatures
6761

68-
#### `u(type, [props], children)`
62+
* `u(type[, props], children)` — create a [parent][]
63+
* `u(type[, props], value)` — create a [text][]
64+
* `u(type[, props])` — create a void node
6965

70-
`type`: `String`<br>
71-
`props`: `Object`<br>
72-
`children`: `Array`<br>
66+
###### Parameters
7367

74-
Creates a node from `props` and given child nodes.
68+
* `type` (`string`) — node [type][]
69+
* `props` (`Object`) — other values assigned to `node`
70+
* `children` ([`Array.<Node>`][node]) — children of `node`
71+
* `value` (`*`) — value of `node` (cast to string)
7572

76-
## Install
73+
###### Returns
7774

78-
```
79-
npm install unist-builder
80-
```
75+
[`Node`][node].
76+
77+
## Related
78+
79+
* [`unist-builder-blueprint`](https://github.com/syntax-tree/unist-builder-blueprint)
80+
— Convert unist trees to `unist-builder` notation
81+
* [`hastscript`](https://github.com/syntax-tree/hastscript)
82+
— Create [hast][] elements
83+
84+
## Contribute
85+
86+
See [`contributing.md` in `syntax-tree/unist`][contributing] for ways to get
87+
started.
88+
89+
This organisation has a [Code of Conduct][coc]. By interacting with this
90+
repository, organisation, or community you agree to abide by its terms.
8191

8292
## License
8393

84-
MIT
94+
[MIT][license] © Eugene Sharygin
95+
96+
<!-- Definitions -->
97+
98+
[travis-badge]: https://img.shields.io/travis/syntax-tree/unist-builder.svg
99+
100+
[travis]: https://travis-ci.org/syntax-tree/unist-builder
101+
102+
[codecov-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-builder.svg
103+
104+
[codecov]: https://codecov.io/github/syntax-tree/unist-builder
105+
106+
[npm]: https://docs.npmjs.com/cli/install
107+
108+
[license]: license
109+
110+
[contributing]: https://github.com/syntax-tree/unist/blob/master/contributing.md
111+
112+
[coc]: https://github.com/syntax-tree/unist/blob/master/code-of-conduct.md
113+
114+
[unist]: https://github.com/syntax-tree/unist
115+
116+
[hast]: https://github.com/syntax-tree/hast
117+
118+
[hyperscript]: https://github.com/dominictarr/hyperscript
119+
120+
[node]: https://github.com/syntax-tree/unist#node
121+
122+
[parent]: https://github.com/syntax-tree/unist#parent
123+
124+
[text]: https://github.com/syntax-tree/unist#text
125+
126+
[type]: https://github.com/syntax-tree/unist#type

0 commit comments

Comments
 (0)