Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document default marks and how to pass options #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/slate-mark-hotkeys/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` | `<strong>`
`i` | `<em>`
`u` | `<u>`
``` ` ``` | `<code>`
`~` | `<del>`

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.
Expand Down