skills/comark.dev/migrate-mdc-to-comark

migrate-mdc-to-comark

Installation
SKILL.md

Migrate from @nuxtjs/mdc to Comark

@nuxtjs/mdc was Nuxt-only. Comark is its successor: the markdown syntax is fully compatible, your .md files need no changes. What changes is the JavaScript API.

The migration has two parts: Core Package (programmatic API) and Nuxt Module (components, slots, config).

Quick Overview

  • Package: @nuxtjs/mdc → comark (core only) or @comark/vue (Vue renderer and Nuxt module)
  • Parse: parseMarkdown() → parseMarkdown() · factory: createMarkdownParser() (sync, no await)
  • Render: stringifyMarkdown() → renderMarkdown() from comark/render
  • AST: object tree → compact tuples ['tag', props, ...children]
  • Result: result.body / result.data → document.nodes / document.frontmatter
  • Renderer: <MDCRenderer :body :data> → <MarkdownDocument :value>
  • All-in-one: <MDC :value> → <Markdown :value>
  • Slots: <MDCSlot /> → native <slot />
  • Plugins: global nuxt.config → per-component defineMarkdownComponent({ plugins })
  • Binding: {{ path }} via opt-in binding() plugin + render-time data prop (namespaced paths: data., frontmatter., meta., props.)
  • Markdown files: component syntax unchanged; update binding paths if you used bare MDC names
Installs
73
First Seen
Apr 21, 2026