From 0029413d941ce39e5c90609cc6dfc4eea613e258 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Fri, 11 Jan 2019 08:29:02 +0100 Subject: [PATCH] Document default marks and how to pass options --- packages/slate-mark-hotkeys/Readme.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/slate-mark-hotkeys/Readme.md b/packages/slate-mark-hotkeys/Readme.md index fc4af4d..a536fad 100644 --- a/packages/slate-mark-hotkeys/Readme.md +++ b/packages/slate-mark-hotkeys/Readme.md @@ -21,6 +21,26 @@ const plugins = [ /> ``` +If you call `MarkHotKeys()` without any parameters, the following marks are set up by default: + +Hotkey | Rendered Tag +--- | --- +`b` | `` +`i` | `` +`u` | `` +``` ` ``` | `` +`~` | `` + +You may overwrite the default options by passing additional options as an object. + +```js +const plugins = [ + MarkHotkeys({ + optionKey: optionValue + }) +] +``` + Option | Type | Description --- | --- | --- **`keysToMarks`** | `Object` | An optional object whose keys are hotkey descriptors and whose respective values are the marks to be applied when the hotkey is triggered. Keys without a `+` in them are automatically prepended with `mod+`, but those with an `+` are not modified. They are all passed to `isHotkey`, which has its own [API](https://www.npmjs.com/package/is-hotkey) for defining hotkeys. Defaults to a map containing marks for bold, underline, italics, strikethrough, and code.