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

navigation_with_keys = False #1503

Merged
merged 3 commits into from Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 0 additions & 15 deletions docs/user_guide/keyboard-shortcuts.md
Expand Up @@ -3,18 +3,3 @@
## Trigger the search bar

You can trigger the search bar pop-up with {kbd}`Ctrl`/{kbd}`⌘` + {kbd}`K`.

## Change pages

By default, you can move to the previous/next page using the {octicon}`arrow-left` (left arrow) and {octicon}`arrow-right` (right arrow) keys on a keyboard.
To disable this behavior, use the following configuration:

```py
html_theme_options = {
"navigation_with_keys": False
}
```

```{attention}
Keep in mind that many readers use their keyboards and other assistive technology to interact with web documents. If you disable the keyboard navigation, you might be making your documentaion inaccessible to many readers.
```
13 changes: 13 additions & 0 deletions src/pydata_sphinx_theme/__init__.py
Expand Up @@ -50,6 +50,19 @@ def update_config(app):
"Use the sphinx-favicon extension instead."
)

# TODO: in 0.15, set the default navigation_with_keys value to False and remove this deprecation notice
if (
hasattr(theme_options, "navigation_with_keys")
and theme_options["navigation_with_keys"] is None
):
drammock marked this conversation as resolved.
Show resolved Hide resolved
logger.warning(
"The default value for `navigation_with_keys` will change to `False` in the next minor release."
"If you wish to guard the old behavior for your site, set `navigation_with_keys` to `True` in your `theme.conf` file."
drammock marked this conversation as resolved.
Show resolved Hide resolved
"Be aware that `navigation_with_keys = True` has negative accessibility implications:"
"https://github.com/pydata/pydata-sphinx-theme/issues/1492"
)
theme_options["navigation_with_keys"] = False

# Validate icon links
if not isinstance(theme_options.get("icon_links", []), list):
raise ExtensionError(
Expand Down
Expand Up @@ -23,7 +23,7 @@ favicons =
show_prev_next = True
search_bar_text = Search the docs ...
search_bar_position = sidebar
navigation_with_keys = True
navigation_with_keys =
collapse_navigation = False
navigation_depth = 4
show_nav_level = 1
Expand Down