Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related GH-28. Closes GH-29. Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com> Reviewed-by: Junyoung Choi <fluke8259@gmail.com> Reviewed-by: Titus Wormer <tituswormer@gmail.com>
- Loading branch information
1 parent
2385f87
commit 635ad84
Showing
6 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Minimum TypeScript Version: 3.2 | ||
|
||
import {Node} from 'unist' | ||
import {TOCOptions} from 'mdast-util-toc' | ||
|
||
declare namespace remarkToc { | ||
type TOCSettings = Pick<TOCOptions, 'heading' | 'maxDepth' | 'tight' | 'skip'>; | ||
} | ||
|
||
/** | ||
* Generate a Table of Contents. | ||
* | ||
* @param settings configuration for generating the table of contents | ||
*/ | ||
declare function remarkToc( | ||
settings?: remarkToc.TOCSettings | ||
): (node: Node) => void | ||
|
||
export = remarkToc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import remark = require('remark') | ||
|
||
import toc = require('remark-toc') | ||
|
||
remark().use(toc) | ||
|
||
remark().use(toc, {}) | ||
|
||
remark().use(toc, { | ||
heading: 'heading' | ||
}) | ||
|
||
remark().use(toc, { | ||
maxDepth: 2 | ||
}) | ||
|
||
remark().use(toc, { | ||
tight: true | ||
}) | ||
|
||
remark().use(toc, { | ||
skip: 'skip-heading' | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": ["es2015"], | ||
"strict": true, | ||
"baseUrl": ".", | ||
"paths": { | ||
"remark-toc": ["index.d.ts"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "dtslint/dtslint.json", | ||
"rules": { | ||
"semicolon": false, | ||
"whitespace": false | ||
} | ||
} |