Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5a7b95e
refactor: separate packages for vue, react and nuxt
farnabaz Mar 5, 2026
aabdf41
chore: updates tests
farnabaz Mar 5, 2026
f8ee0bb
update docs
farnabaz Mar 5, 2026
3917a08
Merge branch 'main' into refactor/separate-packages
atinux Mar 5, 2026
1142716
docs: improvement
atinux Mar 5, 2026
1e05d65
update docs
farnabaz Mar 5, 2026
f8b8aa6
Merge branch 'main' into refactor/separate-packages
farnabaz Mar 5, 2026
b499ef6
Update 1.installation.md
atinux Mar 5, 2026
b706d66
Update 1.installation.md
atinux Mar 5, 2026
9bfbd8d
chore: fix import
atinux Mar 5, 2026
9673212
Merge branch 'main' into refactor/separate-packages
atinux Mar 5, 2026
1732142
Merge branch 'main' into refactor/separate-packages
farnabaz Mar 6, 2026
7051a73
refactor: move plugins components to renderer packages
farnabaz Mar 9, 2026
c87f342
lint: fix
farnabaz Mar 9, 2026
1cdb1cd
fix: stub
farnabaz Mar 9, 2026
05ba321
up
farnabaz Mar 9, 2026
9f188a2
chore: update build command
farnabaz Mar 9, 2026
2348fc3
Merge branch 'main' into refactor/separate-packages
farnabaz Mar 9, 2026
7e3cf03
up
farnabaz Mar 9, 2026
2e0d031
test: disable browser in ci
farnabaz Mar 9, 2026
de0ed87
up
farnabaz Mar 9, 2026
1a4cdde
test: update vitest cofnig
farnabaz Mar 9, 2026
a0e3531
chore: update plugins structure
farnabaz Mar 9, 2026
01bbab2
update packages and docs
farnabaz Mar 10, 2026
8dc1a43
Merge branch 'main' into refactor/separate-packages
farnabaz Mar 10, 2026
5b1b5fc
fix: react components
farnabaz Mar 10, 2026
f85da8f
up
farnabaz Mar 10, 2026
5286d18
up
farnabaz Mar 10, 2026
3f02706
up
farnabaz Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
506 changes: 199 additions & 307 deletions AGENTS.md

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions docs/app/components/ComarkDocs.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { defineComarkComponent } from 'comark/vue'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong, as the defineComarkComponent fn is still used below

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm noticing now that the plugins also have the same problem where they export multiple frameworks' components / are bundled (meaning lots of potential issues with package deduplication in end user apps) -- I wonder if the plugins should only export the actual Comark plugin (for example, comarkMermaid), and the framework packages (@comark/svelte, @comark/vue, etc) should re-export them:

// `@comark/svelte/plugin-mermaid`
import { comarkMermaid } from '@comark/plugin-mermaid';
import { Mermaid } from './Mermaid.svelte';

export { Mermaid, comarkMermaid }

That way the vast majority of users still only have one package to install, and treeshaking will still work great...

import math from '@comark/math'
import mermaid from '@comark/mermaid'
import cjk from '@comark/cjk'
import { Math } from '@comark/math/vue'
import { Mermaid } from '@comark/mermaid/vue'
import { defineComarkComponent } from '@comark/vue'
import math, { Math } from '@comark/vue/plugins/math'
import mermaid, { Mermaid } from '@comark/vue/plugins/mermaid'
import ProsePre from './landing/ProsePre.vue'
import highlight from 'comark/plugins/highlight'
import githubLight from '@shikijs/themes/github-light'
Expand All @@ -15,7 +12,6 @@ export default defineComarkComponent({
plugins: [
math(),
mermaid(),
cjk(),
highlight({
themes: {
light: githubLight,
Expand Down
5 changes: 2 additions & 3 deletions docs/app/components/ContentRenderer.global.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import type { AsyncComponentLoader, PropType } from 'vue'
import htmlTags from '@nuxtjs/mdc/runtime/parser/utils/html-tags-list'
import { globalComponents, localComponents } from '#content/components'
import { useRuntimeConfig } from '#imports'
import { ComarkRenderer } from 'comark/vue'
import alert from 'comark/plugins/alert'
import { Mermaid } from '@comark/mermaid/vue'
import alert from '@comark/vue/plugins/alert'
import { Mermaid } from '@comark/vue/plugins/mermaid'
import type { ComarkTree, ComarkElement } from 'comark/ast'
import type { MinimarkNode, MinimarkTree } from 'minimark'

Expand Down
2 changes: 1 addition & 1 deletion docs/app/components/Playground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { parse } from 'comark'
import highlight from 'comark/plugins/highlight'
import { renderMarkdown } from 'comark/string'
import { ComarkRenderer } from 'comark/vue'
import { ComarkRenderer } from '@comark/vue'
import { Splitpanes, Pane } from 'splitpanes'
import { defaultMarkdown } from '~/constants'
import { watchDebounced } from '@vueuse/core'
Expand Down
24 changes: 20 additions & 4 deletions docs/app/components/og-image/OgImageDocs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,22 @@ function truncate(str: string, max: number) {
style="width:200px;background:#eab308;padding:48px 0;"
>
<div style="flex:1;display:flex;align-items:center;justify-content:center;">
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="62" viewBox="0 0 208 128" fill="none">
<path stroke="#09090b" stroke-width="8" d="M199 9v110H9V9h190Z" />
<path fill="#09090b" d="M128 51.25V32h19.937v19.25H128ZM128 96V76.75h19.937V96H128ZM158.063 51.25V32H178v19.25h-19.937Zm0 44.75V76.75H178V96h-19.937ZM30 98V30h20l20 25 20-25h20v68H90V59L70 84 50 59v39H30Z" />
<svg
xmlns="http://www.w3.org/2000/svg"
width="100"
height="62"
viewBox="0 0 208 128"
fill="none"
>
<path
stroke="#09090b"
stroke-width="8"
d="M199 9v110H9V9h190Z"
/>
<path
fill="#09090b"
d="M128 51.25V32h19.937v19.25H128ZM128 96V76.75h19.937V96H128ZM158.063 51.25V32H178v19.25h-19.937Zm0 44.75V76.75H178V96h-19.937ZM30 98V30h20l20 25 20-25h20v68H90V59L70 84 50 59v39H30Z"
/>
</svg>
</div>
<div style="font-family:'Geist Mono';font-size:11px;font-weight:600;color:#09090b;letter-spacing:0.12em;opacity:0.5;">
Expand All @@ -41,7 +54,10 @@ function truncate(str: string, max: number) {
style="position:absolute;inset:0;background-image:radial-gradient(circle, rgba(234,179,8,0.03) 1px, transparent 1px);background-size:28px 28px;"
/>

<div class="flex flex-col flex-1 justify-center" style="position:relative;z-index:1;padding:48px 56px;">
<div
class="flex flex-col flex-1 justify-center"
style="position:relative;z-index:1;padding:48px 56px;"
>
<div
v-if="headline"
style="font-family:'Geist Mono';font-size:13px;font-weight:600;letter-spacing:0.2em;text-transform:uppercase;color:#eab308;margin-bottom:24px;"
Expand Down
3 changes: 0 additions & 3 deletions docs/app/pages/stream.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script setup lang="ts">
import { computed, nextTick, ref } from 'vue'
import { Comark } from 'comark/vue'
import { useMDCStream } from '../composables/useMDCStream'
import { stringToStream } from '../composables/stringToStream'
import resolveComponent from '../utils/components-manifest'
Expand Down Expand Up @@ -143,8 +142,6 @@ Everything you need for modern content parsing

:landing-code-block

:landing-cjk

`

const bytesLength = computed(() => state.value.content.length)
Expand Down
1 change: 0 additions & 1 deletion docs/app/pages/test.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import { Comark } from 'comark/vue'
import highlight from 'comark/plugins/highlight'
import resolveComponent from '../utils/components-manifest'

Expand Down
26 changes: 13 additions & 13 deletions docs/content/1.getting-started/0.introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Comark parses this into an AST that can be rendered to [HTML](/rendering/html).

```vue [Vue]
<script setup lang="ts">
import { Comark } from 'comark/vue'
import { Comark } from '@comark/vue'
import Alert from './Alert.vue'

const content = `
Expand All @@ -55,7 +55,7 @@ Welcome to Comark!
```

```tsx [React]
import { Comark } from 'comark/react'
import { Comark } from '@comark/react'
import Alert from './Alert.tsx'

const content = `
Expand Down Expand Up @@ -125,27 +125,27 @@ Comark is ideal for:

::card-group
#default
::card{icon="i-lucide-zap" title="Fast Parsing"}
::card{icon="i-lucide-zap" title="Fast Parsing" to="/api/parse"}
Optimized parser that handles large documents efficiently with minimal memory usage.
::

::card{icon="i-lucide-component" title="Component Syntax"}
::card{icon="i-lucide-component" title="Component Syntax" to="/syntax/components"}
Embed custom components in Markdown with props, slots, and nested children.
::

::card{icon="i-lucide-radio" title="Streaming Support"}
::card{icon="i-lucide-radio" title="Streaming Support" to="/rendering/streaming"}
Real-time incremental parsing for AI chat interfaces and live content.
::

::card{icon="i-lucide-code" title="Framework Agnostic"}
::card{icon="i-lucide-code" title="Framework Agnostic" to="/rendering/vue"}
First-class support for both Vue and React with dedicated renderers.
::

::card{icon="i-lucide-palette" title="Syntax Highlighting"}
::card{icon="i-lucide-palette" title="Syntax Highlighting" to="/plugins/core/highlight"}
Built-in Shiki integration for beautiful code blocks with theme support.
::

::card{icon="i-lucide-file-text" title="GFM Support"}
::card{icon="i-lucide-file-text" title="GFM Support" to="/syntax/markdown"}
Full GitHub Flavored Markdown support including tables, task lists, and more.
::
::
Expand Down Expand Up @@ -174,22 +174,22 @@ Ready to get started? Follow these guides:

::card-group{cols="2"}
::card{icon="i-lucide-download" title="Installation" to="/getting-started/installation"}
Install Comark in your project
Install Comark in your project.
::

::card{icon="i-lucide-book-open" title="Comark Syntax" to="/syntax/components"}
Learn the component syntax
Learn how to use components in Markdown.
::

::card{icon="i-lucide-file-code" title="HTML Rendering" to="/rendering/html"}
Render Comark to HTML strings
Render Comark to HTML strings..
::

::card{icon="i-simple-icons-vuedotjs" title="Vue Rendering" to="/rendering/vue"}
Render Comark in Vue applications
Render Comark in Vue applications.
::

::card{icon="i-lucide-atom" title="React Rendering" to="/rendering/react"}
Render Comark in React applications
Render Comark in React applications.
::
::
Loading
Loading