1212
1313## Contents
1414
15- * [ What is this?] ( #what-is-this )
16- * [ When should I use this?] ( #when-should-i-use-this )
17- * [ Install] ( #install )
18- * [ Use] ( #use )
19- * [ API] ( #api )
20- * [ ` toc(tree[, options]) ` ] ( #toctree-options )
21- * [ ` Options ` ] ( #options )
22- * [ ` Result ` ] ( #result )
23- * [ Types] ( #types )
24- * [ Compatibility] ( #compatibility )
25- * [ Security] ( #security )
26- * [ Related] ( #related )
27- * [ Contribute] ( #contribute )
28- * [ License] ( #license )
15+ * [ What is this?] ( #what-is-this )
16+ * [ When should I use this?] ( #when-should-i-use-this )
17+ * [ Install] ( #install )
18+ * [ Use] ( #use )
19+ * [ API] ( #api )
20+ * [ ` toc(tree[, options]) ` ] ( #toctree-options )
21+ * [ ` Options ` ] ( #options )
22+ * [ ` Result ` ] ( #result )
23+ * [ Types] ( #types )
24+ * [ Compatibility] ( #compatibility )
25+ * [ Security] ( #security )
26+ * [ Related] ( #related )
27+ * [ Contribute] ( #contribute )
28+ * [ License] ( #license )
2929
3030## What is this?
3131
@@ -119,10 +119,10 @@ This default behavior can be changed by passing `options.parents`.
119119
120120###### Parameters
121121
122- * ` tree ` ([ ` Node ` ] [ node ] )
123- — tree to search and generate from
124- * ` options ` ([ ` Options ` ] [ api-options ] , optional)
125- — configuration
122+ * ` tree ` ([ ` Node ` ] [ node ] )
123+ — tree to search and generate from
124+ * ` options ` ([ ` Options ` ] [ api-options ] , optional)
125+ — configuration
126126
127127###### Returns
128128
@@ -134,47 +134,47 @@ Configuration (TypeScript type).
134134
135135###### Fields
136136
137- * ` heading ` (` string ` , optional)
138- — heading to look for, wrapped in ` new RegExp('^(' + value + ')$', 'i') `
139- * ` maxDepth ` (` number ` , default: ` 6 ` )
140- — maximum heading depth to include in the table of contents.
141- This is inclusive: when set to ` 3 ` , level three headings are included
142- (those with three hashes, ` ### ` )
143- * ` skip ` (` string ` , optional)
144- — headings to skip, wrapped in ` new RegExp('^(' + value + ')$', 'i') ` .
145- Any heading matching this expression will not be present in the table of
146- contents
147- * ` parents ` ([ ` Test ` ] [ test ] , default: ` tree ` )
148- — allow headings to be children of certain node types.
149- Can by any [ ` unist-util-is ` ] [ is ] compatible test
150- * ` tight ` (` boolean ` , default: ` false ` )
151- — whether to compile list items tightly
152- * ` ordered ` (` boolean ` , default: ` false ` )
153- — whether to compile list items as an ordered list, otherwise they are
154- unordered
155- * ` prefix ` (` string ` , optional)
156- — add a prefix to links to headings in the table of contents.
157- Useful for example when later going from mdast to hast and sanitizing with
158- ` hast-util-sanitize ` .
137+ * ` heading ` (` string ` , optional)
138+ — heading to look for, wrapped in ` new RegExp('^(' + value + ')$', 'i') `
139+ * ` maxDepth ` (` number ` , default: ` 6 ` )
140+ — maximum heading depth to include in the table of contents.
141+ This is inclusive: when set to ` 3 ` , level three headings are included
142+ (those with three hashes, ` ### ` )
143+ * ` skip ` (` string ` , optional)
144+ — headings to skip, wrapped in ` new RegExp('^(' + value + ')$', 'i') ` .
145+ Any heading matching this expression will not be present in the table of
146+ contents
147+ * ` parents ` ([ ` Test ` ] [ test ] , default: ` tree ` )
148+ — allow headings to be children of certain node types.
149+ Can by any [ ` unist-util-is ` ] [ is ] compatible test
150+ * ` tight ` (` boolean ` , default: ` false ` )
151+ — whether to compile list items tightly
152+ * ` ordered ` (` boolean ` , default: ` false ` )
153+ — whether to compile list items as an ordered list, otherwise they are
154+ unordered
155+ * ` prefix ` (` string ` , optional)
156+ — add a prefix to links to headings in the table of contents.
157+ Useful for example when later going from mdast to hast and sanitizing with
158+ ` hast-util-sanitize ` .
159159
160160### ` Result `
161161
162162Results (TypeScript type).
163163
164164###### Fields
165165
166- * ` index ` (` number ` or ` undefined ` )
167- — index of the node right after the table of contents heading, ` -1 ` if no
168- heading was found, ` undefined ` if no ` heading ` was given
169- * ` endIndex ` (` number ` or ` undefined ` )
170- — index of the first node after ` heading ` that is not part of its section,
171- ` -1 ` if no heading was found, ` undefined ` if no ` heading ` was given, same as
172- ` index ` if there are no nodes between ` heading ` and the first heading in
173- the table of contents
174- * ` map ` ([ ` List ` ] [ list ] or ` undefined ` )
175- — list representing the generated table of contents, ` undefined ` if no
176- table of contents could be created, either because no heading was found or
177- because no following headings were found
166+ * ` index ` (` number ` or ` undefined ` )
167+ — index of the node right after the table of contents heading, ` -1 ` if no
168+ heading was found, ` undefined ` if no ` heading ` was given
169+ * ` endIndex ` (` number ` or ` undefined ` )
170+ — index of the first node after ` heading ` that is not part of its section,
171+ ` -1 ` if no heading was found, ` undefined ` if no ` heading ` was given, same as
172+ ` index ` if there are no nodes between ` heading ` and the first heading in
173+ the table of contents
174+ * ` map ` ([ ` List ` ] [ list ] or ` undefined ` )
175+ — list representing the generated table of contents, ` undefined ` if no
176+ table of contents could be created, either because no heading was found or
177+ because no following headings were found
178178
179179## Types
180180
@@ -224,12 +224,12 @@ Always use [`hast-util-santize`][sanitize] when transforming to [hast][].
224224
225225## Related
226226
227- * [ ` github-slugger ` ] ( https://github.com/Flet/github-slugger )
228- — generate a slug just like GitHub does
229- * [ ` unist-util-visit ` ] ( https://github.com/syntax-tree/unist-util-visit )
230- — visit nodes
231- * [ ` unist-util-visit-parents ` ] ( https://github.com/syntax-tree/unist-util-visit-parents )
232- — like ` visit ` , but with a stack of parents
227+ * [ ` github-slugger ` ] ( https://github.com/Flet/github-slugger )
228+ — generate a slug just like GitHub does
229+ * [ ` unist-util-visit ` ] ( https://github.com/syntax-tree/unist-util-visit )
230+ — visit nodes
231+ * [ ` unist-util-visit-parents ` ] ( https://github.com/syntax-tree/unist-util-visit-parents )
232+ — like ` visit ` , but with a stack of parents
233233
234234## Contribute
235235
0 commit comments