Headings
Process headings from your document
Remark Heading
Apply ids to headings.
Extract TOC
By default, it extracts the headings (table of contents) of a document to vfile.data.toc
.
You can disable it with:
Custom Ids
You can customise the heading id with [#slug]
.
Output
An array of TOCItemType
.
Prop | Type | Default |
---|---|---|
title | ReactNode | - |
url | string | - |
depth | number | - |
Rehype Toc
Export table of contents (an array of TOCItemType
), it allows JSX nodes which is not possible with a Remark plugin.
It requires MDX.js.
Usage
Output
For a Markdown document:
An export will be created:
Edit on GitHub
Last updated on