@cudoment/cudoc
v0.5.0
Published
Reusable document ASTs: validation, queries, export and loading for cross-document embedding.
Maintainers
Readme
@cudoment/cudoc
Markdown document semantics, compilation, AST queries, cross-document embedding and dataset projection.
ESM · Node.js 20+
npm install @cudoment/cudocimport { compileDocument } from "@cudoment/cudoc/markdown"
import { renderDocument } from "@cudoment/cudoc/render"
const { tree } = compileDocument(
"## Setup (#setup)\n\n> [!NOTE] Requirements\n> Node.js 20+.",
{ format: "md", syntax: {} },
)
const html = renderDocument(tree)The root and query APIs provide reusable AST operations. Import compilation from /markdown, rendering from /render, and collection from /node/library. Node entry points belong in build/server code. /embed handles individual AST snapshots; complete libraries and fenced embeds use the explicit node/* APIs. The core has no React runtime dependency.
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.
