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

migrate-mdc-to-comark

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/mdccomark (core only) or @comark/nuxt (Nuxt module)
  • Parse: parseMarkdown()parse() · factory: createParse() (sync, no await)
  • Render: stringifyMarkdown()renderMarkdown() from comark/render
  • AST: object tree → compact tuples ['tag', props, ...children]
  • Result: result.body / result.datatree.nodes / tree.frontmatter
  • Renderer: <MDCRenderer :body :data><ComarkRenderer :tree>
  • All-in-one: <MDC :value><Comark :markdown>
  • Slots: <MDCSlot /> → native <slot />
  • Plugins: global nuxt.config → per-component defineComarkComponent({ plugins })
  • Markdown files: no changes needed
Installs
12
First Seen
Apr 21, 2026