Skip to content

Commit 3549b5f

Browse files
committed
Update README
1 parent 28c6479 commit 3549b5f

File tree

3 files changed

+70
-4
lines changed

3 files changed

+70
-4
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016 Oneteam Inc.
3+
Copyright (c) 2016 Atsushi NAGASE
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,68 @@
1-
# draft-js-markdown-shortcuts-plugin
2-
A DraftJS plugin for supporting Markdown syntax shortcuts
1+
draft-js-markdown-shortcuts-plugin
2+
==================================
3+
4+
A [DraftJS] plugin for supporting Markdown syntax shortcuts
5+
6+
This plugin works with [DraftJS Plugins] wrapper component.
7+
8+
[View Demo][Demo]
9+
10+
Usage
11+
-----
12+
13+
```sh
14+
npm i --save draft-js-markdown-shortcuts-plugin
15+
```
16+
17+
then import from your editor component
18+
19+
```js
20+
import createMarkdownShortcutsPlugin from 'draft-js-markdown-shortcuts-plugin';
21+
```
22+
23+
Example
24+
-------
25+
26+
```js
27+
import React, { Component } from 'react';
28+
import Editor from 'draft-js-plugins-editor';
29+
import createMarkdownShortcutsPlugin from 'draft-js-markdown-shortcuts-plugin';
30+
import { EditorState } from 'draft-js';
31+
32+
const plugins = [
33+
createMarkdownShortcutsPlugin()
34+
];
35+
36+
export default class DemoEditor extends Component {
37+
38+
state = {
39+
editorState: EditorState.createEmpty(),
40+
};
41+
42+
onChange = (editorState) => {
43+
this.setState({
44+
editorState,
45+
});
46+
};
47+
48+
render() {
49+
return (
50+
<Editor
51+
editorState={this.state.editorState}
52+
onChange={this.onChange}
53+
plugins={plugins}
54+
/>
55+
);
56+
}
57+
}
58+
```
59+
60+
License
61+
-------
62+
63+
MIT. See [LICENSE]
64+
65+
[Demo]: https://ngs.github.io/draft-js-markdown-shortcuts-plugin
66+
[DraftJS]: https://facebook.github.io/draft-js/
67+
[DraftJS Plugins]: https://github.com/draft-js-plugins/draft-js-plugins
68+
[LICENSE]: ./LICENSE

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "draft-js-markdown-shortcuts-plugin",
3-
"version": "1.0.0",
3+
"version": "0.0.1",
44
"description": "A DraftJS plugin for supporting Markdown syntax shortcuts",
55
"main": "lib/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)