1 | # remark [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat]
|
2 |
|
3 | The [**remark**][remark] processor is a markdown processor powered by
|
4 | [plug-ins][plugins].
|
5 |
|
6 | * Interface by [**unified**][unified];
|
7 | * [**mdast**][mdast] syntax tree;
|
8 | * Parses markdown to the tree with [**remark-parse**][parse];
|
9 | * [Plug-ins][plugins] transform the tree;
|
10 | * Compiles the tree to markdown using [**remark-stringify**][stringify].
|
11 |
|
12 | Don’t need the parser? Or the compiler? [That’s OK][unified-usage].
|
13 |
|
14 | ## Installation
|
15 |
|
16 | [npm][]:
|
17 |
|
18 | ```bash
|
19 | npm install remark
|
20 | ```
|
21 |
|
22 | ## Usage
|
23 |
|
24 | ```js
|
25 | var remark = require('remark');
|
26 | var lint = require('remark-lint');
|
27 | var html = require('remark-html');
|
28 | var report = require('vfile-reporter');
|
29 |
|
30 | remark().use(lint).use(html).process('## Hello world!', function (err, file) {
|
31 | console.error(report(err || file));
|
32 | console.log(String(file));
|
33 | });
|
34 | ```
|
35 |
|
36 | Yields:
|
37 |
|
38 | ```txt
|
39 | 1:1 warning Missing newline character at end of file final-newline
|
40 | 1:1-1:16 warning First heading level should be `1` first-heading-level
|
41 | 1:1-1:16 warning Don’t add a trailing `!` to headings no-heading-punctuation
|
42 |
|
43 | ⚠ 3 warnings
|
44 | <h2>Hello world!</h2>
|
45 | ```
|
46 |
|
47 | ## License
|
48 |
|
49 | [MIT][license] © [Titus Wormer][author]
|
50 |
|
51 |
|
52 |
|
53 | [build-badge]: https://img.shields.io/travis/wooorm/remark.svg
|
54 |
|
55 | [build-status]: https://travis-ci.org/wooorm/remark
|
56 |
|
57 | [coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/remark.svg
|
58 |
|
59 | [coverage-status]: https://codecov.io/github/wooorm/remark
|
60 |
|
61 | [chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg
|
62 |
|
63 | [chat]: https://gitter.im/wooorm/remark
|
64 |
|
65 | [license]: https://github.com/wooorm/remark/blob/master/LICENSE
|
66 |
|
67 | [author]: http://wooorm.com
|
68 |
|
69 | [npm]: https://docs.npmjs.com/cli/install
|
70 |
|
71 | [remark]: https://github.com/wooorm/remark
|
72 |
|
73 | [unified]: https://github.com/wooorm/unified
|
74 |
|
75 | [mdast]: https://github.com/wooorm/mdast
|
76 |
|
77 | [parse]: https://github.com/wooorm/remark/blob/master/packages/remark-parse
|
78 |
|
79 | [stringify]: https://github.com/wooorm/remark/blob/master/packages/remark-stringify
|
80 |
|
81 | [plugins]: https://github.com/wooorm/remark/blob/master/doc/plugins.md
|
82 |
|
83 | [unified-usage]: https://github.com/wooorm/unified#usage
|