comark

comark

A high-performance markdown parser and renderer with Vue & React components support.

Stars: 207

Visit
 screenshot

Comark is a high-performance markdown parser and renderer that supports Vue & React components. It features a fast markdown-exit based parser, stream API for buffered parsing, Comark component syntax support, auto-close unclosed markdown syntax, frontmatter parsing (YAML), automatic table of contents generation, and full TypeScript support. It is designed to efficiently parse and render markdown content with support for Vue and React components.

README:

comark

npm version npm downloads CI Documentation license

A high-performance markdown parser and renderer with Vue & React components support.

Features

  • πŸš€ Fast markdown-exit based parser
  • πŸ“¦ Stream API for buffered parsing
  • πŸ”§ Comark component syntax support
  • πŸ”’ Auto-close unclosed markdown syntax (perfect for streaming)
  • πŸ“ Frontmatter parsing (YAML)
  • πŸ“‘ Automatic table of contents generation
  • 🎯 Full TypeScript support

Installation

npm install comark
# or
pnpm add comark

Usage

Vue

<script setup lang="ts">
import { Comark } from 'comark/vue'
import cjk from '@comark/cjk'
import math from '@comark/math'
import { Math } from '@comark/math/vue'

const chatMessage = ...
</script>

<template>
  <Comark :components="{ Math }" :plugins="[cjk(), math()]">{{ chatMessage }}</Comark>
</template>

React

import { Comark } from 'comark/react'
import cjk from '@comark/cjk'
import math from '@comark/math'
import { Math } from '@comark/math/react'

function App() {
  const chatMessage = ...
  return <Comark components={{ Math }} plugins={[cjk(), math()]}>{chatMessage}</Comark>
}

License

Made with ❀️

Published under MIT License.

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for comark

Similar Open Source Tools

For similar tasks

For similar jobs