Skip to content

tuanjs/react-cherry-markdown

Repository files navigation

react-cherry-markdown

✨ A React Markdown Editor

GitHub Pages

Getting Started

Install dependencies,

npm i @tuanjs/react-cherry-markdown

Start the dev server,

npm start

Build documentation,

npm run docs:build

Run test,

npm test

Build library via father-build,

npm run build

Example

import React from 'react';
import { CherryEditor } from '@tuanjs/react-cherry-markdown';
import * as echarts from 'echarts';
import MathJax from 'mathjax/es5/tex-svg';

export default () => {
  const md = '## Hello react-cherry-markdown!';
  return (
    <CherryEditor
      engine={{
        syntax: {
          table: {
            enableChart: true,
          },
          // mathBlock: {
          //   engine: 'katex',
          // },
          // inlineMath: {
          //   engine: 'katex',
          // },
        },
      }}
      externals={{
        echarts,
        MathJax,
      }}
      value={md}
    />
  );
};

Configuration

Tencent cherry-markdown configuration