Skip to content

Commit

Permalink
Merge branch 'develop' into replace-live-server
Browse files Browse the repository at this point in the history
# Conflicts:
#	package-lock.json
  • Loading branch information
jhildenbiddle committed Dec 11, 2023
2 parents 9c2d29f + cf61192 commit d9a7f30
Show file tree
Hide file tree
Showing 10 changed files with 3,417 additions and 13,864 deletions.
48 changes: 48 additions & 0 deletions docs/configuration.md
Expand Up @@ -288,6 +288,54 @@ window.$docsify = {
};
```

## keyBindings

- Type: `Boolean|Object`
- Default: `Object`
- <kbd>\\</kbd> Toggle the sidebar menu
- <kbd>/</kbd> Focus on [search](plugins#full-text-search) field. Also supports <kbd>alt</kbd>&nbsp;/&nbsp;<kbd>ctrl</kbd>&nbsp;+&nbsp;<kbd>k</kbd>.

Binds key combination(s) to a custom callback function.

Key `bindings` are defined as case insensitive string values separated by `+`. Modifier key values include `alt`, `ctrl`, `meta`, and `shift`. Non-modifier key values should match the keyboard event's [key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) or [code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code) value.

The `callback` function receive a [keydown event](https://developer.mozilla.org/en-US/docs/Web/API/Element/keydown_event) as an argument.

!> Let site visitors know your custom key bindings are available! If a binding is associated with a DOM element, consider inserting a `<kbd>` element as a visual cue (e.g., <kbd>alt</kbd> + <kbd>a</kbd>) or adding [title](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title) and [aria-keyshortcuts](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-keyshortcuts) attributes for hover/focus hints.

```js
window.$docsify = {
keyBindings: {
// Custom key binding
myCustomBinding: {
bindings: ['alt+a', 'shift+a'],
callback(event) {
alert('Hello, World!');
},
},
},
};
```

Key bindings can be disabled entirely or individually by setting the binding configuration to `false`.

```js
window.$docsify = {
// Disable all key bindings
keyBindings: false,
};
```

```js
window.$docsify = {
keyBindings: {
// Disable individual key bindings
focusSearch: false,
toggleSidebar: false,
},
};
```

## loadNavbar

- Type: `Boolean|String`
Expand Down

0 comments on commit d9a7f30

Please sign in to comment.