cudoc

cudoc guides

English | 한국어 · Project home

This page leads to the setup guide for each host, the host demos, the supported versions, the .md/.mdx choice and the guide to each cudoc feature.

Guides teach the workflow. The API reference holds signatures, defaults and contracts.

Set up your site

Each guide is a numbered walkthrough: install, configure, wire up collection, build. Every step is a copy-pasteable command or file, so you can work through one yourself or hand it to a coding agent. Every guide ends with a table of what you can then write, and the host-specific details worth knowing.

Your site Guide
Next.js Next.js →
Docusaurus Docusaurus →
Nextra Nextra →
VitePress VitePress →
Eleventy Eleventy →
No generator yet HTML export →

A syntax-only setup ends at host configuration. Document embedding needs collection to run before the site build, and each guide marks where that line falls.

Host demos

Each host renders the same two Markdown files with cudoc. Each demo is published as that host built it. portable.md uses the syntax extensions and embeds three views of reference.md: a summary of its headings, one section reworded, and an outline. Open a demo beside the two files to compare what an author writes with what the host draws.

Host Demo, built by the host Guide Runnable example
Next.js 16.4.2 Portable documents Next.js examples/next-mdx
Docusaurus 3.10.2 Portable documents Docusaurus examples/docusaurus
Nextra 4.6.0 Portable documents Nextra examples/nextra
VitePress 1.6.4 Portable documents VitePress examples/vitepress
Eleventy 3.1.7 Portable documents Eleventy examples/eleventy

A demo is its example built from the example's own lockfile, so it shows the tested release the next table names, and its navigation links to the two Markdown files, its guide and its code. The demos deploy with this documentation site when a release completes. The site itself is not a host demo: cudoc-export built it from the README and docs/ with no site generator, and Export shows the other pages it makes.

Two differences between the demos come from the hosts rather than from cudoc:

Supported versions

cudoc needs Node.js 22 or later, and every package is ESM. For each host the table gives the release every cudoc change is tested against, what a new project installed on the date shown was checked with, the releases cudoc supports, and the peer range the adapter declares to npm.

Host Tested with Checked on a fresh install, 2026-10-19 Supported Declared peer range
Next.js Next.js 16.4.2 with @next/mdx 16.4.2 the same releases Next.js 16.4 and later 16.x no host peer: cudoc-remark is a remark plugin
Docusaurus Docusaurus 3.10.2 the same release 3.10 and later 3.x @docusaurus/core ^3.10.0
Nextra Nextra 4.6.0 on Next.js 15.5.28 fails: Nextra 4.6.1 on Next.js 16.4.2 beside zod 4.6.7, the Nextra defect below. It builds with zod pinned to 4.3.6 or Nextra pinned to 4.6.0, and on Next.js 15.5.28 with zod 4.3.6; on Next.js 16 each needs --webpack Nextra 4.6.0, and 4.6.1 with zod below 4.4, on Next.js 15 or 16 with webpack no host peer: cudoc-nextra is a set of remark plugins
VitePress VitePress 1.6.4 the same release 1.6.4 and later 1.x vitepress ^1.6.4, markdown-it ^14.1.0
Eleventy Eleventy 3.1.7 the same release, with markdown-it-attrs 5.0.1 and markdown-it-anchor 10.0.0 Eleventy 3.1 and later 3.x @11ty/eleventy ^3.1.0, markdown-it ^14.1.0

The four columns mean the following:

Four setups are outside support:

Five integration details depend on the host's own version; re-check them when you upgrade it:

cudoc follows semantic versioning, and all eight packages share one version. The compatibility it promises covers what the API reference documents of the following, and a module a package does not export is not part of it at all:

The reference also describes how the current release works, and that part is no promise. It covers which problems the check finds, message wording, the positions and suggestions it reports, the layout of a text report, and processing details such as thresholds, retries and the order of steps. A minor release may change these, and so may a patch release that fixes a defect.

Report a defect at github.com/cudoment/cudoc/issues; the form asks, among other things, for the host with its version, the cudoc version and the smallest document that shows the problem.

Choosing .md or .mdx

Every cudoc feature works in both. Anchors, badges, callouts and lists inside table cells compile to plain HTML elements on every host and in either format, so nothing in this project asks you to write .mdx. The choice is about your own content: .mdx exists so that you can author React components.

On Nextra alone the format changes how two features are drawn. A code block's title goes to Nextra's own code component only in .mdx, so a .md page shows it framed as on hosts without one. Tab components named in tabElements are used only in .mdx, so a .md page shows cudoc's own tabs.

The format is decided per file, by its extension, not per project. Collection reads the extension the same way the host does, so one directory can hold both.

Your site .md .mdx How the choice is made
Next.js yes yes format: "detect" in the @next/mdx options
Docusaurus yes yes markdown: { format: "detect" }
Nextra yes yes format: "detect" in mdxOptions
VitePress yes no markdown-it has no MDX parser
Eleventy yes no markdown-it has no MDX parser
HTML export yes needs a renderer per component components have nowhere to resolve from

The two markdown-it hosts do not mangle an .mdx file they cannot read. Collection stops with the reason:

cudoc-vitepress: markdown-it hosts compile Markdown .md documents, not React .mdx

That is a parser boundary rather than a policy. Components are still available on those hosts by their own route: VitePress renders Vue components written directly in .md, and cudoc normalizes a static <Badge> when badge takes host syntax. → VitePress

What a component costs you

A component renders only where it is registered. That is fine in the document that owns it. It stops being fine once an embed copies that section into another document, because HTML export has no registry to resolve the name against. cudoc check reports that at check time instead of leaving it for export time.

So the rule of thumb is narrow: keep sections that other documents embed in Markdown, and put components wherever else you like.

Learn the features

One guide per feature:

Guide What it covers
Markdown syntax Anchors, badges, callouts, lists and merged cells in tables, table notes, code titles, tabs, variables, shared link references, column layouts, syntax modes
Document embedding Collection, section selection, summary tables, document trees, find-and-replace, refresh rules
Export HTML sites, single pages and review pages, PDF and Word, alongside a host or alone; site structure, hyperlink policies, assets
Reference checking Finding broken links, anchors, images, embeds and tables, letter case and missing translations across the whole document set, and the same check in your editor
AST datasets Filtering compiled documents into AST JSON for indexing and other consumers

Reference and examples

API reference documents public imports, signatures, option defaults, AST metadata, persistence and compiler ordering. Runnable examples are working host integrations you can build locally.

Scope

cudoc covers Markdown syntax normalization, cross-document embedding, AST projection and HTML generation. Configuration belongs in the site setup; authors write ordinary Markdown and cudoc markers, and never import or register cudoc components.

Native syntax support is limited to the forms each guide lists. Arbitrary host plugins and dynamic components do not automatically become portable: a component whose content depends on runtime state cannot travel through an embed or into exported HTML. Live link monitoring is not provided; collection does repeat on change through cudoc collect --watch, described under Build and refresh.

cudoc