Table of Contents

Extract headings from your document

Usage

It extracts headings of the MDX document to vfile.data.toc. You may write your own plugin to convert it into a MDX export.

import { remarkToc } from 'next-docs-zeta/mdx-plugins';
 
export default {
  remarkPlugins: [remarkToc],
};

Output

An array of TOCItemType.

TOCItemType

PropTypeDescription
titlestringTitle of heading
urlstringHref url
depthnumberFrom 1 to 6

Last updated on