1
- # mdast-util-to-string [ ![ Build Status] [ travis -badge]] [ travis ] [ ![ Coverage Status] [ coverage-badge ]] [ coverage ]
1
+ # mdast-util-to-string [ ![ Build Status] [ build -badge]] [ build-status ] [ ![ Coverage Status] [ coverage-badge ]] [ coverage-status ] [ ![ Chat ] [ chat-badge ]] [ chat ]
2
2
3
- [ ** remark** ] [ remark ] utility to get the plain text
4
- content of an [ ** mdast** ] [ mdast ] node.
3
+ <!-- lint disable list-item-spacing heading-increment list-item-indent-->
4
+
5
+ Get the plain text content of an [ MDAST] [ ] node.
5
6
6
7
## Installation
7
8
8
- [ npm] [ npm-install ] :
9
+ [ npm] [ ] :
9
10
10
11
``` bash
11
12
npm install mdast-util-to-string
12
13
```
13
14
14
- ** mdast-util-to-string** is also available for [ duo] [ ] ,
15
- and as an AMD, CommonJS, and globals module,
16
- [ uncompressed and compressed] [ releases ] .
15
+ ** mdast-util-to-string** is also available as an AMD, CommonJS, and
16
+ globals module, [ uncompressed and compressed] [ releases ] .
17
17
18
18
## Usage
19
19
20
- ``` js
21
- /*
22
- * Dependencies.
23
- */
20
+ Dependencies:
24
21
22
+ ``` js
25
23
var remark = require (' remark' );
26
24
var toString = require (' mdast-util-to-string' );
25
+ ```
27
26
28
- /*
29
- * AST.
30
- */
27
+ Parse:
31
28
32
- var ast = remark .parse (' Some *emphasis*, **strongness**, and `code`.' );
29
+ ``` js
30
+ var ast = remark ().parse (' Some *emphasis*, **strongness**, and `code`.' );
31
+ ```
33
32
33
+ Stringify:
34
+
35
+ ``` js
34
36
toString (ast);
35
37
// 'Some emphasis, strongness, and code.'
36
38
```
@@ -46,40 +48,44 @@ If no value is found, the algorithm checks the children of `node` and
46
48
joins them (without spaces or newlines).
47
49
48
50
> This is not a markdown to plain-text library.
49
- > Use [ strip-markdown] ( https://github.com/wooorm/ strip-markdown) for that.
51
+ > Use [ ` strip-markdown ` ] [ strip-markdown ] for that.
50
52
51
- ** Parameters** :
53
+ ###### Parameters
52
54
53
- * ` node ` ([ ` Node ` ] [ mdast- node] ).
55
+ * ` node ` ([ ` Node ` ] [ node ] ) — Node to stringify
54
56
55
- ** Returns** : ` string ` — text representation of ` node ` .
57
+ ###### Returns
58
+
59
+ ` string ` — text representation of ` node ` .
56
60
57
61
## License
58
62
59
- [ MIT] [ license ] © [ Titus Wormer] [ home ]
63
+ [ MIT] [ license ] © [ Titus Wormer] [ author ]
60
64
61
65
<!-- Definitions -->
62
66
63
- [ travis -badge] : https://img.shields.io/travis/wooorm/mdast-util-to-string.svg
67
+ [ build -badge] : https://img.shields.io/travis/wooorm/mdast-util-to-string.svg
64
68
65
- [ travis ] : https://travis-ci.org/wooorm/mdast-util-to-string
69
+ [ build-status ] : https://travis-ci.org/wooorm/mdast-util-to-string
66
70
67
71
[ coverage-badge ] : https://img.shields.io/codecov/c/github/wooorm/mdast-util-to-string.svg
68
72
69
- [ coverage ] : https://codecov.io/github/wooorm/mdast-util-to-string
73
+ [ coverage-status ] : https://codecov.io/github/wooorm/mdast-util-to-string
70
74
71
- [ remark ] : https://github.com/ wooorm/remark
75
+ [ chat-badge ] : https://img.shields.io/gitter/room/ wooorm/remark.svg
72
76
73
- [ mdast ] : https://github.com/wooorm/mdast
77
+ [ chat ] : https://gitter.im/wooorm/remark
78
+
79
+ [ releases ] : https://github.com/wooorm/mdast-util-to-string/releases
74
80
75
- [ mdast-node ] : https://github.com/wooorm/mdast#node
81
+ [ license ] : LICENSE
76
82
77
- [ npm-install ] : https ://docs.npmjs. com/cli/install
83
+ [ author ] : http ://wooorm. com
78
84
79
- [ duo ] : http ://duojs.org/#getting-started
85
+ [ npm ] : https ://docs.npmjs.com/cli/install
80
86
81
- [ releases ] : https://github.com/wooorm/mdast-util-to-string/releases
87
+ [ mdast ] : https://github.com/wooorm/mdast
82
88
83
- [ license ] : LICENSE
89
+ [ node ] : https://github.com/wooorm/mdast#node
84
90
85
- [ home ] : http ://wooorm .com
91
+ [ strip-markdown ] : https ://github .com/wooorm/strip-markdown
0 commit comments