Custom remark plugins for enhanced Markdown processing
npm install remark-plugins remark-directive # or yarn add remark-plugins remark-directive # or bun install remark-plugins remark-directive # or pnpm add remark-plugins remark-directive
remark-directive
remark-plugins
import ReactMarkdown from 'react-markdown'; import remarkDirective from 'remark-directive'; import { remarkCallout, remarkEmbed, slugifyHeading } from 'remark-plugins'; <ReactMarkdown remarkPlugins={[remarkDirective, remarkCallout, remarkEmbed, slugifyHeading]} > {markdownContent} </ReactMarkdown>;
::callout[warn]{title=Warning} This is a custom note content. :::
::embed[youtube]{id=yaodD79Q4iE .some-class} # or ::embed[iframe]{id=http://google.com .some-class}
# My Heading This heading will have an ID of `my-heading`.