1.4.3 • Published 3 years ago

zenn-mde v1.4.3

Weekly downloads
24
License
MIT
Repository
-
Last release
3 years ago

Zenn MDE

npm.io npm version npm download GitHub license Tweet

ZennMDE is a Markdown Editor which enables you to write contents smoothly even with a large amount of content.

FirefoxChromeSafariiOS Safari

ScreenShot

Not Yet

Features

  • Fully customizable
  • Synced scroll position across the contents and the preview
  • No stress writing even with a large amount of content

Install

$ npm install zenn-mde --save

Usage

import React, { useCallback, useState } from 'react';
import { render } from 'react-dom';
import { Editor, useProvider } from 'zenn-mde';
import markdownToHtml from "zenn-markdown-html";
import 'zenn-mde/css/editor.css';

const MDE = () => {
  const [markdown, setMarkdown] = useState('')
  const handleValueChange = useCallback((newValue: string) => {
    setMarkdown(newValue);
  }, []);

  return (
    <Provider>
      <Editor
        previewClassName="znc"
        value={markdown}
        onChange={handleValueChange}
        parser={markdownToHtml}
      />
    </Provider>
  )
}

render(<MDE />, document.getElementById("app"));

Try it on CodeSandbox

Not yet...

Props

PropsDescriptionTypeDefault
commandskey bindsRecord< string, Command>;
previewClassNameclass name to be applied to preview area"znc"
previewCallbackmorphdom callbacks to be applied to preview areaRecord<string, Function>{}
parsermarkdown parser function( text : string ) => Promise <string>
valuemarkdownstring""
onChangecallback when markdown changed( value : string ) => void
psudoModehighlight markdown area with highlight.jsbooleanfalse
debounceTimedebounced time to apply markdown result to preview areanumber3000

Download

Download ZIP

Github

https://github.com/zenn-dev/zenn-mde

Contributor

@steelydylan

License

Code and documentation copyright 2020 by zenn-dev, Inc. Code released under the MIT License.

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.3.5

3 years ago

1.4.0

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago