1
- # mdast-util-position [ ![ Build Status] [ travis -badge]] [ travis ] [ ![ Coverage Status] [ coverage-badge ]] [ coverage ]
1
+ # mdast-util-position [ ![ Build Status] [ build -badge]] [ build-status ] [ ![ Coverage Status] [ coverage-badge ]] [ coverage-status ] [ ![ Chat ] [ chat-badge ]] [ chat ]
2
2
3
- [ ** mdast ** ] [ mdast ] utility to get the position of nodes.
3
+ <!-- lint disable heading-increment no-duplicate-headings -->
4
4
5
- * Supports index-based positional information patched by
6
- [ ** mdast-range** ] [ mdast-range ] ;
5
+ [ ** mdast** ] [ mdast ] utility to get the position of nodes.
7
6
7
+ * Supports index-based positional information;
8
8
* Supports [ ` indent ` ] [ mdast-indent ] .
9
9
10
- Utility to get the style of an [ ** mdast** ] [ mdast ] heading.
11
-
12
10
## Installation
13
11
14
- [ npm] [ npm-install ] :
12
+ [ npm] [ ] :
15
13
16
14
``` bash
17
15
npm install mdast-util-position
18
16
```
19
17
20
- ** mdast-util-position** is also available for [ duo] [ ] ,
21
- and as an AMD, CommonJS, and globals module,
22
- [ uncompressed and compressed] [ releases ] .
18
+ ** mdast-util-position** is also available as an AMD, CommonJS, and
19
+ globals module, [ uncompressed and compressed] [ releases ] .
23
20
24
21
## Usage
25
22
26
23
``` js
27
24
var remark = require (' remark' );
28
25
var position = require (' mdast-util-position' );
29
26
30
- var ast = remark .parse ([
27
+ var ast = remark () .parse ([
31
28
' # foo' ,
32
29
' ' ,
33
30
' * bar' ,
@@ -49,57 +46,64 @@ position.generated() // true
49
46
50
47
### ` position.end([node]) `
51
48
52
- Get the heading style of a node.
49
+ Get the bound position of ` node ` .
53
50
54
- ** Parameters** :
51
+ ###### Parameters
55
52
56
- * ` node ` ([ ` Node ` ] [ mdast- node] ) — Node to check;
53
+ * ` node ` ([ ` Node? ` ] [ node ] ) — Node to check.
57
54
58
- ** Returns** ([ ` Position ` ] [ mdast-position ] ) — Filled with ` line `
59
- (nullable ` uint32 >= 1 ` ) and ` column ` (nullable ` uint32 >= 1 ` ).
55
+ ###### Returns
56
+
57
+ [ ` Position ` ] [ mdast-position ] — Filled with ` line ` (nullable
58
+ ` uint32 >= 1 ` ), ` column ` (nullable ` uint32 >= 1 ` ), ` offset ` (nullable
59
+ ` uint32 >= 0 ` ), and ` indent ` .
60
60
61
61
### ` position.generated([node]) `
62
62
63
63
Get the heading style of a node.
64
64
65
- ** Parameters** :
65
+ ###### Parameters
66
66
67
67
* ` node ` ([ ` Node ` ] [ mdast-node ] ) — Node to check;
68
68
69
- ** Returns** (` boolean ` ) — Whether or not ` node ` has positional
70
- information (both starting and ending lines and columns). This is
71
- useful when checking if a node is inserted by plug-ins.
69
+ ###### Returns
70
+
71
+ ` boolean ` — Whether or not ` node ` has positional information (both
72
+ starting and ending lines and columns). This is useful when checking
73
+ if a node is inserted by plug-ins.
72
74
73
75
## License
74
76
75
- [ MIT] [ license ] © [ Titus Wormer] [ home ]
77
+ [ MIT] [ license ] © [ Titus Wormer] [ author ]
76
78
77
79
<!-- Definitions -->
78
80
79
- [ travis -badge] : https://img.shields.io/travis/wooorm/mdast-util-position.svg
81
+ [ build -badge] : https://img.shields.io/travis/wooorm/mdast-util-position.svg
80
82
81
- [ travis ] : https://travis-ci.org/wooorm/mdast-util-position
83
+ [ build-status ] : https://travis-ci.org/wooorm/mdast-util-position
82
84
83
85
[ coverage-badge ] : https://img.shields.io/codecov/c/github/wooorm/mdast-util-position.svg
84
86
85
- [ coverage ] : https://codecov.io/github/wooorm/mdast-util-position
87
+ [ coverage-status ] : https://codecov.io/github/wooorm/mdast-util-position
86
88
87
- [ mdast ] : https://github.com/ wooorm/mdast
89
+ [ chat-badge ] : https://img.shields.io/gitter/room/ wooorm/remark.svg
88
90
89
- [ mdast-node ] : https://github.com/wooorm/mdast#node
91
+ [ chat ] : https://gitter.im/wooorm/remark
92
+
93
+ [ releases ] : https://github.com/wooorm/mdast-util-position/releases
90
94
91
- [ mdast-range ] : https://github.com/wooorm/mdast-range
95
+ [ license ] : LICENSE
92
96
93
- [ mdast-indent ] : https ://github .com/wooorm/mdast#location
97
+ [ author ] : http ://wooorm .com
94
98
95
- [ mdast-position ] : https://github. com/wooorm/mdast/blob/master/doc/nodes.md#position
99
+ [ npm ] : https://docs.npmjs. com/cli/install
96
100
97
- [ npm-install ] : https://docs.npmjs. com/cli/install
101
+ [ mdast ] : https://github. com/wooorm/mdast
98
102
99
- [ duo ] : http ://duojs.org/#getting-started
103
+ [ node ] : https ://github.com/wooorm/mdast#node
100
104
101
- [ releases ] : https://github.com/wooorm/mdast-util-position/releases
105
+ [ mdast-node ] : https://github.com/wooorm/mdast#node
102
106
103
- [ license ] : LICENSE
107
+ [ mdast-indent ] : https://github.com/wooorm/mdast#location
104
108
105
- [ home ] : http ://wooorm .com
109
+ [ mdast-position ] : https ://github .com/wooorm/mdast/blob/master/doc/nodes.md#position
0 commit comments