//comarkbyarashsheyda

comark

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

0
0
0
TypeScript

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.

[beta]v0.14.0