CC

comarkdown/comark

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

1082 stars 品質 71 トレンド 45MIT

Angular、React、Svelte、Vue、HTML、ANSI向けの高性能Markdownパーサーおよびレンダラーです。

概要

HTML、ANSI、Vue、React、Svelte、AngularのJavaScriptライブラリ、プラグインやストリーミングで、どこでもMarkdownを解析・レンダリングできます。 ComarkはCommonMarkとGFMをサポートし、それらを構築時、実行時、またはストリーム中にコンパクトでシリアライズ可能なドキュメントに解析します。同じドキュメントをレンダラー間で使用するか、より豊かなコンテンツが必要な場合は読みやすいコンポーネントや属性で構文を拡張します。 - : parseMarkdown(markdown)は、コンパクトで直列化可能なMarkdownドキュメントを返す純粋な関数です。データベース、CMS、LLMからのコンテンツは保存された瞬間にライブとなります。再構築や再デプロイは不要です。(Comark対MDX)- : 自動クローズが終了しない構文を完了します(**パーサー1つ、すべてのレンダラー**依然Markdownのみ**プラグインエコシステム**Decoupled parse & render**Fast**:markdown-exit(markdown-itのTypeScriptリライト)を基に構築され、TypeScriptも完全サポート。 コンポーネントと属性の構文は、MDCでの5年間の本番環境での使用に基づいています。全文については「Why Comark」をご覧ください。

概要(AI 翻訳)

Comarkは、コンポーネント、属性、プラグインを備えたオープンソースのMarkdownパーサーおよびレンダラーです。AI出力をReact、Vue、Svelte、Angular、HTML、ターミナルにストリーミング配信します。

ComarkはCommonMarkとGFMをサポートし、それらを構築時、実行時、またはストリーム中にコンパクトでシリアライズ可能なドキュメントに解析します。同じドキュメントをレンダラー間で使用するか、より豊かなコンテンツが必要な場合は読みやすいコンポーネントや属性で構文を拡張します。

なぜコマークなのか

  • ランタイム解析:parseMarkdown(markdown)は、コンパクトでシリアライズ可能なMarkdownドキュメントを返す純粋な関数です。データベース、CMS、LLMからのコンテンツは保存された瞬間に稼働します。再構築や再デプロイはありません。(ComarkとMDXの比較)
  • ストリーミング内蔵:自動クローズは終了していない構文(**bold、開いたコードフェンス、半開のコンポーネント)を補完し、AI出力が毎フレーム正しくレンダリングされます。
  • すべてのレンダラーは1つのパーサーで:同じソースがHTML、ANSI、Vue、React、Svelte、Angularにレンダリングされます。あなたのコンテンツはフレームワークよりも長く保存されます。
  • **依然としてMarkdownのみ:CommonMark + GFM(いくつかの違いあり)、フロントマター、ネイティブ要素の{.class}属性。コンポーネントはオプトインの構文であり、新しい言語ではありません。

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

comark

Comark is an open-source Markdown parser and renderer with components, attributes and plugins. It streams AI output to React, Vue, Svelte, Angular, HTML and the terminal.

Comark supports CommonMark and GFM, then parses them into a compact, serializable document at build time, runtime, or during a stream. Use the same document across renderers, or extend the syntax with readable components and attributes when you need richer content.

# Regular Markdown

With a custom component:

::alert{type="warning"}
This is **Markdown** inside your own component.
::

Why Comark

  • Runtime parsing: parseMarkdown(markdown) is a pure function returning a compact, serializable Markdown document. Content from a database, CMS, or LLM is live the moment it is saved. No rebuild, no redeploy. (Comark vs MDX)
  • Streaming built in: auto-close completes unterminated syntax (**bold, open code fences, half-open components) so AI output renders correctly at every frame.
  • One parser, every renderer: the same source renders to HTML, ANSI, Vue, React, Svelte, and Angular. Your content outlasts your framework.
  • Still just Markdown: CommonMark + GFM (with a few differences), frontmatter, and {.class} attributes on native elements. Components are opt-in syntax, not a new language.
  • Plugin ecosystem: Shiki highlighting, KaTeX math, Mermaid diagrams, TOC, alerts, footnotes and more, plus compatibility with existing markdown-it plugins.
  • Decoupled parse & render: parse once on the server, send the serializable document (['tag', props, ...children]) to the client, render without re-parsing.
  • Fast: built on markdown-exit, a TypeScript rewrite of markdown-it, with full TypeScript support.

The component and attribute syntax builds on five years of production use in MDC. Read Why Comark for the full story.

Quick Start

GitHub で README 全文を見る

推奨ツール

別のキーワードを試すか、フィルタを外してください。

インストール

npx skillfish add comarkdown/comark
MCP 初心者?mcpskill.org のガイドから始めましょう →