UNPKG

@mintlify/common

Version:

Commonly shared code within Mintlify

14 lines (13 loc) 452 B
import { remark } from 'remark'; import remarkFrontmatter from 'remark-frontmatter'; import remarkGfm from 'remark-gfm'; import remarkMath from 'remark-math'; import remarkMdx from 'remark-mdx'; export const coreRemarkMdxPlugins = [ remarkMdx, remarkGfm, [remarkFrontmatter, ['yaml', 'toml']], remarkMath, ]; export const coreRemark = remark().use(coreRemarkMdxPlugins).freeze(); export const getAST = (str) => coreRemark().parse(str);