Skip to content

Commit 3227141

Browse files
committed
Refactor prose
1 parent a2d84ef commit 3227141

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

readme.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,21 @@
1818
npm install mdast-util-heading-style
1919
```
2020

21-
## Usage
21+
## Use
2222

2323
```js
2424
var style = require('mdast-util-heading-style')
25-
var remark = require('remark')()
25+
var unified = require('unified')
26+
var parse = require('remark-parse')
2627

27-
style(remark.parse('# ATX').children[0]) // => 'atx'
28-
style(remark.parse('# ATX #\n').children[0]) // => 'atx-closed'
29-
style(remark.parse('ATX\n===').children[0]) // => 'setext'
28+
var processor = unified().use(parse)
3029

31-
style(remark.parse('### ATX').children[0]) // => null
32-
style(remark.parse('### ATX').children[0], 'setext') // => 'setext'
30+
style(processor.parse('# ATX').children[0]) // => 'atx'
31+
style(processor.parse('# ATX #\n').children[0]) // => 'atx-closed'
32+
style(processor.parse('ATX\n===').children[0]) // => 'setext'
33+
34+
style(processor.parse('### ATX').children[0]) // => null
35+
style(processor.parse('### ATX').children[0], 'setext') // => 'setext'
3336
```
3437

3538
## API
@@ -60,8 +63,8 @@ See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
6063
started.
6164
See [`support.md`][support] for ways to get help.
6265

63-
This project has a [Code of Conduct][coc].
64-
By interacting with this repository, organisation, or community you agree to
66+
This project has a [code of conduct][coc].
67+
By interacting with this repository, organization, or community you agree to
6568
abide by its terms.
6669

6770
## License
@@ -92,7 +95,7 @@ abide by its terms.
9295

9396
[collective]: https://opencollective.com/unified
9497

95-
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
98+
[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg
9699

97100
[chat]: https://spectrum.chat/unified/syntax-tree
98101

0 commit comments

Comments
 (0)