initial commit

This commit is contained in:
Cory Dransfeldt 2022-05-21 17:27:30 -07:00
commit d799808203
126 changed files with 16265 additions and 0 deletions

View file

@ -0,0 +1,17 @@
//@ts-nocheck
import { Parent } from 'unist'
import { visit } from 'unist-util-visit'
import { slug } from 'github-slugger'
import { toString } from 'mdast-util-to-string'
export default function remarkTocHeadings(options) {
return (tree: Parent) =>
visit(tree, 'heading', (node) => {
const textContent = toString(node)
options.exportRef.push({
value: textContent,
url: '#' + slug(textContent),
depth: node.depth,
})
})
}