Get TOC

Parse Table of contents from markdown/mdx content

Parse Table of contents from markdown/mdx content.

Usage

Note: If you're using a CMS, you should use the API provided by the CMS instead.

import { getTableOfContents } from 'fumadocs-core/server';
 
const toc = getTableOfContents('## markdown content');

Output

An array of TOCItemType is returned.

Edit on GitHub

Last updated on

On this page