Skip to content

Commit

Permalink
Merge stable into master
Browse files Browse the repository at this point in the history
  • Loading branch information
CKEditorBot authored Sep 18, 2023
2 parents 905f480 + dfb8300 commit d37d4fe
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions docs/tutorials/crash-course/plugin-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@ modified_at: 2023-08-16

## Configuration convention

As we learned at the beginning of this tutorial, the editor accepts a configuration object that allows you to change its default behavior and appearance.
As we learned at the beginning of this tutorial, the editor accepts a configuration object that allows you to change its default behavior and appearance. The convention used in CKEditor 5 is to have a unique object key for each plugin to avoid conflicts and to make it obvious what each part of the configuration does.

For the purpose of this tutorial, we will add a single option to configure the keyboard shortcut for highlighting the selected text.

The convention used in CKEditor is to have a unique object key for each plugin, to avoid conflicts and make it obvious what each part of the configuration does.

Following this convention, we will add an optional `highlight` key to the configuration, which can contain a `keystroke` option:
In this tutorial, we will add a single option to the `highlight` plugin to configure its keyboard shortcut. This configuration will be included in an optional `highlight` key:

```js
const editor = await ClassicEditor.create( element, {
// Other options are omitted for readability - do not remove them.
highlight: {
keystroke: '...'

}
} );
```
Expand All @@ -39,7 +35,7 @@ editor.config.define( 'highlight', {
} );
```

The first parameter passed to the method is the name of the configuration object key, and the second is the defaults.
The first parameter passed to the method is the name of the configuration object key, and the second is the default values.

### Loading configuration option

Expand Down

0 comments on commit d37d4fe

Please sign in to comment.