Getting Started

Introduction

Comark is a powerful Markdown parser that extends standard Markdown with component syntax, enabling rich, interactive content in Vue and React applications.

What is Comark?

Comark stands for Components in Markdown. It's an extension of the Markdown syntax that lets you use components directly inside your Markdown content:

# Welcome to my blog

This is regular **markdown** with a custom component:

::alert{type="warning"}
This is an important message!
::

The ::alert is a block component that supports properties and children (also known as slots). Learn more about the Component Syntax.

Comark parses this into an AST that can be rendered to HTML. It also supports rendering to Vue or React, turning your Markdown into fully interactive content.

<script setup lang="ts">
import { Comark } from 'comark/vue'
import Alert from './Alert.vue'

const content = `
# Hello World

::alert{type="info"}
Welcome to Comark!
::
`
</script>

<template>
  <Comark :components="{ Alert }">{{ content }}</Comark>
</template>

When to Use Comark

Comark is ideal for:

  • Documentation sites - Write docs in Markdown with interactive examples
  • Blog platforms - Rich content with custom components for callouts, embeds, and more
  • AI chat interfaces - Stream and render Markdown responses in real-time
  • CMS integrations - Let content editors use components without touching code
  • Technical writing - Combine prose with live code examples and diagrams

Comparison with Other Tools

FeatureComarkStreamdownMDXMarkdoc
Streaming support
Component syntax
Vue support
React support
No build step
Parse to AST
Compact AST
Auto-close for streams
Decoupled parsing & rendering

Key Features

Fast Parsing

Optimized parser that handles large documents efficiently with minimal memory usage.

Component Syntax

Embed custom components in Markdown with props, slots, and nested children.

Streaming Support

Real-time incremental parsing for AI chat interfaces and live content.

Framework Agnostic

First-class support for both Vue and React with dedicated renderers.

Syntax Highlighting

Built-in Shiki integration for beautiful code blocks with theme support.

GFM Support

Full GitHub Flavored Markdown support including tables, task lists, and more.

How It Works

  1. Parse - Comark parses your content into a compact Comark AST
  2. Transform - The AST can be manipulated, cached, or serialized
  3. Render - Framework-specific renderers convert the AST to Vue or React components

Next Steps

Ready to get started? Follow these guides:

Installation

Install Comark in your project

Comark Syntax

Learn the component syntax

HTML Rendering

Render Comark to HTML strings

Vue Rendering

Render Comark in Vue applications

React Rendering

Render Comark in React applications
Copyright © 2026