Structure

Extract information from your documents

Usage

Accepts MDX/markdown content and return structurized data. Useful for implementing document search.

import { structure } from 'next-docs-zeta/mdx-plugins';
 
structure(page.body.raw);
Tip

If you have custom remark plugins enabled, such as remark-math, you have to manually structurize the document with these plugins passed into the function:

import { structure } from 'next-docs-zeta/mdx-plugins';
import remarkMath from 'remark-math';
 
structure(page.body.raw, [remarkMath]);

Parameters

Parameter
contentMDX/markdown content
remarkPluginsList of remark plugins
optionsCustom options

Output

StructuredData is returned by the function.

Last updated on