Getting started

Installation

Install comark-codemirror with pnpm, npm, or yarn, plus the CodeMirror peer packages and optional rangi or Shiki peers for fence highlighting.
pnpm add comark-codemirror codemirror

comark-codemirror has no runtime dependencies. The CodeMirror packages it builds on are peer dependencies — pnpm and npm install them automatically, and they are shared with the CodeMirror you already use:

@codemirror/state, view, language, autocomplete, commands, lint, lang-markdown, lang-yaml, and @lezer/common, highlight, markdown.

@codemirror/lang-yaml highlights frontmatter and component props blocks as real YAML.

Optional peers

PackageUsed by
rangithe rangi plugin: fence languages rangi can highlight
shikithe shiki plugin: fence languages Shiki bundles

comark itself is not needed at runtime. Your app renders with it; the editor mirrors its syntax.

Copyright © 2026