cudoc-remark
v0.5.0
Published
Remark plugin for cudoc: heading anchors, badges, table cell lists and table column layout, each configurable.
Maintainers
Readme
cudoc-remark
Connect cudoc Markdown syntax and prepared document embeds to a remark/MDX pipeline.
This separate package is a pipeline adapter, not a second implementation of cudoc's rules. Shared document semantics live in @cudoment/cudoc. Use it directly with Next.js/remark; Docusaurus and Nextra adapters already depend on it. VitePress and Eleventy share cudoc-markdown-it, and HTML uses its own adapter; none of them need this plugin.
ESM · Node.js 20+
npm install @cudoment/cudoc cudoc-remark remark-gfmimport remarkGfm from "remark-gfm"
import cudoc from "cudoc-remark"
const remarkPlugins = [remarkGfm, [cudoc, { host: "next", syntax: {} }]]Default settings produce component-free output in both .md and .mdx; syntax: {} makes the defaults explicit. Let the host detect the document format. For Next.js Turbopack, use package-name plugin strings and JSON options as shown in the guide. After collection and preparation, cudoc-remark/embed splices each prepared embed into the page as it compiles, so embedded components render through the host's own component mapping; cudoc-remark/loader keeps a recollection visible to the dev server and the build cache.
Choose host, cudoc or both independently for headingAnchor, badge, tableCellList, callout and link. The representative callout is > [!NOTE] Title. Authors do not register cudoc React components in the recommended setup. Syntax-only rendering needs no stored JSON; cross-document embedding requires document collection.
