Installation
pnpm add comark-codemirror codemirror
npm install comark-codemirror codemirror
yarn 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
| Package | Used by |
|---|---|
rangi | the rangi plugin: fence languages rangi can highlight |
shiki | the shiki plugin: fence languages Shiki bundles |
comark itself is not needed at runtime. Your app renders with it; the editor mirrors its syntax.
Introduction
Learn what comark-codemirror is, how chained autocomplete works in Comark, and why it is built as a CodeMirror 6 extension instead of a separate editor.
Usage
Add the comark() extension to a CodeMirror 6 editor in vanilla JavaScript, Vue, or React, with presets, plugins, and a live playground example.