
Zero-config Nuxt module for Comark — a high-performance markdown parser and renderer.
<Comark> and <ComarkRenderer> components~/components/prose directory for overriding HTML elementsAdd @comark/nuxt to your project — this installs the dependency and registers the module in nuxt.config.ts:
npx nuxt add comark
Add @comark/nuxt to your dependencies:
npm install @comark/nuxt
# or
pnpm add @comark/nuxt
Then add it to your nuxt.config.ts:
export default defineNuxtConfig({
modules: ['@comark/nuxt'],
})
The <Comark> component is available globally — no imports needed. Pass markdown via the default slot or the markdown prop:
<script setup lang="ts">
const content = `# Hello Nuxt\n\nRendered with **Comark**.`
</script>
<template>
<Comark>{{ content }}</Comark>
</template>
Map Comark tags to your own Vue components:
<script setup lang="ts">
import Alert from '~/components/Alert.vue'
</script>
<template>
<Comark :components="{ alert: Alert }">{{ content }}</Comark>
</template>
::alert{type="warning"}
This is a warning.
::
Drop components into ~/components/prose to override how native HTML elements render. They are auto-registered:
~/components/prose/
ProseH1.vue
ProsePre.vue
ProseA.vue
<script setup lang="ts">
import math, { Math } from '@comark/nuxt/plugins/math'
import mermaid, { Mermaid } from '@comark/nuxt/plugins/mermaid'
</script>
<template>
<Comark
:components="{ math: Math, mermaid: Mermaid }"
:plugins="[math(), mermaid()]"
>
{{ content }}
</Comark>
</template>
When @nuxt/ui is installed, prose components are wired up automatically:
export default defineNuxtConfig({
modules: ['@comark/nuxt', '@nuxt/ui'],
})
Full guide and API reference at comark.dev/rendering/nuxt.
Coding agents can install the Comark skill from the docs site:
npx skills add https://comark.dev
Made with ❤️
Published under MIT License.