Fumadocs

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 = await getTableOfContents(page.body.raw);

Output

An array of TOCItemType is returned.

Last updated on

On this page

Edit on Github