Skip to content

Commit

Permalink
updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sereneinserenade committed Sep 3, 2023
1 parent ee9b4a6 commit 2a42b5d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,30 @@ const extensions = [

For more details, look at [react demo.](https://github.com/sereneinserenade/tiptap-comment-extension/blob/main/demos/react/src/components/Tiptap.tsx#L77-L91)

## API:

### Comment.configure

```ts
Comment.configure({
HTMLAttributes: {
class: "my-comment",
},
onCommentActivated: (commentId) => {
setActiveCommentId(commentId);

if (commentId) setTimeout(() => focusCommentWithActiveId(commentId));
},
});
```

## Commands:

- `setComment`: Sets the comment for the current selection with the given commentId. <br/>
Example: `editor.commands.setComment('<a-comment-id>')`
- `unsetComment`: Unsets the comment for the given commentId. <br/>
Example: `editor.commands.setComment('<a-comment-id>')`

## Stargazers

[![Stargazers repo roster for @sereneinserenade/tiptap-comment-extension](https://reporoster.com/stars/dark/sereneinserenade/tiptap-comment-extension)](https://github.com/sereneinserenade/tiptap-comment-extension/stargazers)

0 comments on commit 2a42b5d

Please sign in to comment.