cudoc-nextra
v0.5.0
Published
Nextra adapter for cudoc: remark wiring and default components.
Maintainers
Readme
cudoc-nextra
Connect cudoc to Nextra while retaining native heading IDs and TOC behavior.
ESM · Node.js 20+
npm install @cudoment/cudoc cudoc-remark cudoc-nextraimport { cudocRemarkPlugins } from "cudoc-nextra"
// In the Nextra configuration:
const mdxOptions = {
format: "detect",
remarkPlugins: cudocRemarkPlugins({
syntax: { headingAnchor: "both", callout: "both" },
}),
}Keep the existing Nextra theme mappings and import @cudoment/cudoc/styles.css once. The explicit syntax setup needs no cudoc components. Nextra owns its TOC. For embedding, collect through the actual Nextra compiler, prepare embeds, and add cudoc-remark/embed to rendering.
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.
