Readme for talk-rich-text-pell

This commit is contained in:
okbel
2018-02-23 15:54:34 -03:00
parent 02374345e1
commit 632f80a202
2 changed files with 20 additions and 0 deletions
@@ -0,0 +1,20 @@
# Talk Plugin Rich Text - Pell
Enables rich text support client-side by using [Pell](https://github.com/jaredreich/pell).
## Installation
Add `talk-plugin-rich-text-pell` to the `plugins.json` in your Talk installation. Remember to add this in the `client` property since this plugin only covers the client side. To add server support, please use `talk-plugin-rich-text`.
## How does this work?
This plugin contains 2 important components:
- The Editor (`./components/Editor.js`)
- The Comment Content Renderer (`./components/CommentContent.js`)
The editor component contains the rich text editor. For this particular plugin we chose [Pell](https://github.com/jaredreich/pell). Pell is the simplest and smallest WYSIWYG text editor with no dependencies that we could find.
If you check our `index.js` you will notice that we inject this editor in the `commentBox` slot. We do this to replace the core comment box with this one.
Now, in order to render the new styled comments we need a comment renderer. For this task we will have to replace our core comment renderer by using the `commentContent` slot.
If you are not familiar with GraphQL `client/index.js` will look complicated, but fear not! With those functions we specify what to expect from the server schema, how to perform optimistic updates and how keep the client store updated with the latest changes.
We encourage you to see the files and check how easy is to build plugins! If you have any feedback, please let us know.