-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
62 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,63 @@ | ||
# `yoopta-paragraph` | ||
# Paragraph plugin | ||
|
||
> TODO: description | ||
Paragraph is default plugin for Yoopta-Editor | ||
|
||
## Usage | ||
### Installation | ||
|
||
```bash | ||
yarn add @yoopta/paragraph | ||
``` | ||
const paragraph = require('yoopta-paragraph'); | ||
|
||
// TODO: DEMONSTRATE API | ||
### Usage | ||
|
||
```jsx | ||
import Paragraph from '@yoopta/paragraph'; | ||
|
||
const plugins = [Paragraph]; | ||
|
||
const Editor = () => { | ||
return <YooptaEditor plugins={plugins} />; | ||
}; | ||
``` | ||
|
||
### Default classnames | ||
|
||
- .yoopta-paragraph | ||
|
||
### Default options | ||
|
||
```js | ||
const Paragraph = new YooptaPlugin({ | ||
options: { | ||
display: { | ||
title: 'Text', | ||
description: 'Start writing plain text.', | ||
}, | ||
shortcuts: ['p', 'text'], | ||
}, | ||
}); | ||
``` | ||
|
||
### Options to extend | ||
|
||
```tsx | ||
const plugins = [ | ||
Paragraph.extend({ | ||
renders: { | ||
paragraph: (props) => <YourCustomComponent {...props} /> | ||
}, | ||
options: { | ||
shortcuts: [`<your custom shortcuts>`], | ||
align: 'left' | 'center' | 'right', | ||
display: { | ||
title: `<your custom title>`, | ||
description: `<your custom description>`, | ||
}, | ||
HTMLAttributes: { | ||
className: '<your classname>', | ||
// ...other HTML attributes | ||
}, | ||
}, | ||
}); | ||
]; | ||
``` |