1.3.4 • Published 1 year ago

zhique-editor v1.3.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

zhique-editor

Build Status Build Status

zhique-editor : The open source online code editor (component), based on react & react-markdown & codemirror.

Features

  • Support Standard Markdown / CommonMark and GFM (GitHub Flavored Markdown)
  • Real-time Preview, Code fold, Code syntax highlighting...
  • Synchronized scrolling

Installing

  • npm
npm install zhique-editor codemirror@^5.65.9 github-markdown-css
  • yarn
yarn add zhique-editor codemirror@^5.65.9 github-markdown-css

MarkdownEditor

  1. Basic usage

    import React from 'react';
    import ReactDom from 'react-dom';
    import { MarkdownEditor } from 'zhique-editor';
    import 'codemirror/lib/codemirror';
    import 'codemirror/lib/codemirror.css';
    import 'codemirror/mode/gfm/gfm';
    import 'github-markdown-css/github-markdown.css';
    ReactDom.render(<MarkdownEditor />, document.getElementById('app'));
  2. props

    propdescriptiontypedefault
    widthcomponent widthstring or number90%
    heightcomponent heightstring or number500
    watchReal-time Previewbooltrue
    fullScreenfullScreen modeboolfalse
    valuecomponent valuestring''
    optionsthe options of codeMirrorobject-
    onChangethe component value has been changedfunction(value)-
  3. options

    {
      mode: 'gfm',
      theme: 'default',
      lineWrapping: true,
      lineNumbers: true,
      foldGutter: true,
      gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
      matchBrackets: true,
      autofocus: true,
      autoCloseBrackets: true,
      matchTags: true,
      autoCloseTags: true,
      styleActiveLine: true,
      styleSelectedText: true
    }

    click codemirror configuration for more info.

1.2.0

1 year ago

1.1.0

2 years ago

1.3.4

1 year ago

1.3.3

1 year ago

1.2.4

1 year ago

1.3.2

1 year ago

1.2.3

1 year ago

1.3.1

1 year ago

1.2.2

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.0.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago