File tree Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ var toc = require('mdast-util-toc');
2323Transform:
2424
2525``` javascript
26- var file = remark ().parse ( ([
26+ var input = remark ().parse ([
2727 ' # Alpha' ,
2828 ' ' ,
2929 ' ## Bravo' ,
@@ -33,18 +33,9 @@ var file = remark().parse(([
3333 ' ## Delta' ,
3434 ' '
3535].join (' \n ' ));
36- ` ` `
37-
38- Yields:
39-
40- ` ` ` markdown
41- - [Alpha]
42-
43- - [Bravo](#bravo)
44-
45- - [Charlie](#charlie)
4636
47- - [Delta](#delta)
37+ toc (input);
38+ // [ { type: 'list', ordered: false, children: [ { ... } ] } ]
4839```
4940
5041## API
@@ -53,9 +44,8 @@ Yields:
5344
5445Generate a Table of Contents from a Markdown document.
5546
56- * Looks for the first heading containing ` " Table of Contents" ` , ` " toc" ` ,
57- or ` table- of - contents` (case insensitive, supports alt/title attributes
58- for links and images too);
47+ * If specified, looks for the first heading containing the ` heading ` option
48+ (case insensitive, supports alt/title attributes for links and images too);
5949
6050* Removes all following contents until an equal or higher heading is found;
6151
Original file line number Diff line number Diff line change 11{
22 "name" : " mdast-util-toc" ,
3- "version" : " 1.0 .0" ,
3+ "version" : " 0.1 .0" ,
44 "description" : " Generate a Table of Contents (TOC) from a given Markdown file" ,
55 "main" : " index.js" ,
66 "files" : [
You can’t perform that action at this time.
0 commit comments