Skip to content

Commit

Permalink
Add the documentation for CKEditor5 plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
dtdesign committed Sep 14, 2023
1 parent 7bf7204 commit fa32f8d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/javascript/components_ckeditor5.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,24 @@ listenToCkeditor(element).submitOnEnter(({ ckeditor, html }) => {
// Do something with the resulting `html`.
});
```

## Creating Plugins

CKEditor 5 was designed to be compiled as a single bundle, relying a lot on identity checks to access and associate data.
Any extra plugin that should be added to the editor must be built using the modules exposed through the `setupConfiguration()` event otherwise the identity checks will fail.

```ts
listenToCkeditor(element).setupConfiguration(({ configuration, CKEditor5 }) => {
class FooPlugin extends CKEditor5.Core.Plugin {
static get pluginName() {
return "FooPlugin";
}

init(): void {
//
}
}

configuration.extraPlugins.push(FooPlugin);
});
```

0 comments on commit fa32f8d

Please sign in to comment.