1
- # mdast-util-heading-style [ ![ Build Status] ( https://img.shields.io/ travis/wooorm/mdast-util-heading-style.svg )] ( https:// travis-ci.org/wooorm/mdast-util-heading-style ) [ ![ Coverage Status] ( https://img.shields.io/codecov/c/github/wooorm/mdast-util-heading-style.svg )] ( https://codecov.io/github/wooorm/mdast-util-heading-style )
1
+ # mdast-util-heading-style [ ![ Build Status] [ travis-badge ]] [ travis ] [ ![ Coverage Status] [ coverage-badge ]] [ coverage ]
2
2
3
- Utility to get the style of an [ ** mdast** ] ( https://github.com/wooorm/mdast )
4
- heading.
3
+ Utility to get the style of an [ ** mdast** ] [ mdast ] heading.
5
4
6
5
## Installation
7
6
8
- [ npm] ( https://docs.npmjs.com/cli/ install) :
7
+ [ npm] [ npm- install] :
9
8
10
9
``` bash
11
10
npm install mdast-util-heading-style
12
11
```
13
12
14
- ** mdast-util-heading-style** is also available for [ duo] ( http://duojs.org/#getting-started ) ,
15
- and as an AMD, CommonJS, and globals module, [ uncompressed and
16
- compressed] ( https://github.com/wooorm/mdast-util-heading-style/ releases) .
13
+ ** mdast-util-heading-style** is also available for [ duo] [ ] ,
14
+ and as an AMD, CommonJS, and globals module,
15
+ [ uncompressed and compressed] [ releases ] .
17
16
18
17
## Usage
19
18
@@ -26,25 +25,50 @@ style(remark.parse('# ATX #\n').children[0]); // 'atx-closed'
26
25
style (remark .parse (' ATX\n ===' ).children [0 ]); // 'setext'
27
26
28
27
style (remark .parse (' ### ATX' ).children [0 ]); // null
29
- style (remark .parse (' ### ATX' ).children [0 ], ' setext' ); // 'atx '
28
+ style (remark .parse (' ### ATX' ).children [0 ], ' setext' ); // 'setext '
30
29
```
31
30
32
31
## API
33
32
34
- ### style(node\ [ , relative] )
33
+ ### ` style(node[, relative]) `
35
34
36
35
Get the heading style of a node.
37
36
38
- Parameters:
37
+ ** Parameters** :
39
38
40
- * ` node ` ([ ` Node ` ] ( https://github.com/wooorm/ mdast/blob/master/doc/nodes.md ) );
39
+ * ` node ` ([ ` Node ` ] [ mdast-node ] );
41
40
42
41
* ` relative ` (` string ` , optional) — Style to use for ambiguous headings
43
42
(atx-headings with a level of three or more could also be setext).
44
43
45
- Return: ` string ` (` 'atx' ` , ` 'atx-closed' ` , or ` 'setext' ` ). When an ambiguous
46
- heading is found, either ` relative ` or ` null ` is returned.
44
+ ** Returns** : ` string ` (` 'atx' ` , ` 'atx-closed' ` , or ` 'setext' ` )
45
+ — When an ambiguous heading is found, either ` relative ` or ` null ` is
46
+ returned.
47
47
48
48
## License
49
49
50
- [ MIT] ( LICENSE ) © [ Titus Wormer] ( http://wooorm.com )
50
+ [ MIT] [ license ] © [ Titus Wormer] [ home ]
51
+
52
+ <!-- Definitions -->
53
+
54
+ [ travis-badge ] : https://img.shields.io/travis/wooorm/mdast-util-heading-style.svg
55
+
56
+ [ travis ] : https://travis-ci.org/wooorm/mdast-util-heading-style
57
+
58
+ [ coverage-badge ] : https://img.shields.io/codecov/c/github/wooorm/mdast-util-heading-style.svg
59
+
60
+ [ coverage ] : https://codecov.io/github/wooorm/mdast-util-heading-style
61
+
62
+ [ mdast ] : https://github.com/wooorm/mdast
63
+
64
+ [ mdast-node ] : https://github.com/wooorm/mdast#node
65
+
66
+ [ npm-install ] : https://docs.npmjs.com/cli/install
67
+
68
+ [ duo ] : http://duojs.org/#getting-started
69
+
70
+ [ releases ] : https://github.com/wooorm/mdast-util-heading-style/releases
71
+
72
+ [ license ] : LICENSE
73
+
74
+ [ home ] : http://wooorm.com
0 commit comments