Skip to content

Commit

Permalink
Docs for paragraph (#161)
Browse files Browse the repository at this point in the history
* added docs for paragraph
  • Loading branch information
Darginec05 authored May 16, 2024
1 parent afab659 commit a18b748
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 10 deletions.
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ We'd also love PRs. If you're thinking of a large PR, we advise opening up an is
1. Push to your fork and [submit a pull request][pr].
1. Pat yourself on the back and wait for your pull request to be reviewed and merged.

[//]: # (1. Make sure the tests pass on your machine: `npm test`, note: these tests also apply the linter, so there's no need to lint separately.)
[//]: # (1. Make your change, add tests, and make sure the tests still pass.)
[//]: # "1. Make sure the tests pass on your machine: `yarn test`, note: these tests also apply the linter, so there's no need to lint separately."
[//]: # '1. Make your change, add tests, and make sure the tests still pass.'

Here are a few things you can do that will increase the likelihood of your pull request being accepted:

- Follow the [style guide][style] which is using standard. Any linting errors should be shown when running `npm test`.
- Follow the [style guide][style] which is using standard. Any linting errors should be shown when running `yarn test`.
- Write and update tests.
- Keep your changes as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
Expand All @@ -53,4 +53,3 @@ We welcome everyone to review Pull Requests, it is a great way to learn, network
- do not be rude, disrespectful or aggressive
- do not repeat feedback, this creates more noise than value (check the existing conversation), use GitHub reactions if you agree/disagree with a comment
- do not blindly approve pull requests to improve your GitHub contributors graph

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ All of this is customizable, extensible, and easy to set up!

- Plugins

- **@yoopta/paragraph**
- [**@yoopta/paragraph**](https://github.com/Darginec05/Yoopta-Editor/blob/master/packages/plugins/paragraph/README.md)
- **@yoopta/blockquote**
- **@yoopta/code**
- **@yoopta/embed**
Expand Down Expand Up @@ -317,6 +317,7 @@ If you have any questions or need assistance raise an issue in the GitHub reposi
Let's create powerful and engaging editing experiences together with Yoopta-Editor!

## Project structure

```text
packages/
├── core - core components of the editor
Expand Down
62 changes: 57 additions & 5 deletions packages/plugins/paragraph/README.md
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
},
},
});
];
```

0 comments on commit a18b748

Please sign in to comment.