10
10
11
11
[ ** unist** ] [ unist ] utility to get the positional info of nodes.
12
12
13
- ## Installation
13
+ ## Install
14
14
15
15
[ npm] [ ] :
16
16
17
- ``` bash
17
+ ``` sh
18
18
npm install unist-util-position
19
19
```
20
20
@@ -24,7 +24,7 @@ npm install unist-util-position
24
24
var remark = require (' remark' )
25
25
var position = require (' unist-util-position' )
26
26
27
- var tree = remark ().parse ([ ' # foo' , ' ' , ' * bar' , ' ' ]. join ( ' \n ' ) )
27
+ var tree = remark ().parse (' # foo\n\n * bar\n ' )
28
28
29
29
position .start (tree) // => {line: 1, column: 1}
30
30
position .end (tree) // => {line: 4, column: 1}
@@ -50,13 +50,18 @@ Get the start or end points in the positional info of `node`.
50
50
[ ` Point ` ] [ point ] — Filled with ` line ` (nullable ` uint32 >= 1 ` ),
51
51
` column ` (nullable ` uint32 >= 1 ` ), ` offset ` (nullable ` uint32 >= 0 ` ).
52
52
53
+ Note that in [ unist] [ ] , ` line ` and ` column ` are 1-indexed integers and
54
+ ` offset ` is a 0-indexed integer.
55
+
53
56
## Contribute
54
57
55
- See [ ` contributing.md ` in ` syntax-tree/unist ` ] [ contributing ] for ways to get
58
+ See [ ` contributing.md ` in ` syntax-tree/.github ` ] [ contributing ] for ways to get
56
59
started.
60
+ See [ ` support.md ` ] [ support ] for ways to get help.
57
61
58
- This organisation has a [ Code of Conduct] [ coc ] . By interacting with this
59
- repository, organisation, or community you agree to abide by its terms.
62
+ This project has a [ Code of Conduct] [ coc ] .
63
+ By interacting with this repository, organisation, or community you agree to
64
+ abide by its terms.
60
65
61
66
## License
62
67
@@ -96,12 +101,14 @@ repository, organisation, or community you agree to abide by its terms.
96
101
97
102
[ npm ] : https://docs.npmjs.com/cli/install
98
103
104
+ [ contributing ] : https://github.com/syntax-tree/.github/blob/master/contributing.md
105
+
106
+ [ support ] : https://github.com/syntax-tree/.github/blob/master/support.md
107
+
108
+ [ coc ] : https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
109
+
99
110
[ unist ] : https://github.com/syntax-tree/unist
100
111
101
112
[ node ] : https://github.com/syntax-tree/unist#node
102
113
103
114
[ point ] : https://github.com/syntax-tree/unist#point
104
-
105
- [ contributing ] : https://github.com/syntax-tree/unist/blob/master/contributing.md
106
-
107
- [ coc ] : https://github.com/syntax-tree/unist/blob/master/code-of-conduct.md
0 commit comments