-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
[RFC]: add support for keyboard shortcuts #26
Comments
Given that more than two themes may be supported, should think about how keyboard shortcuts should work for theming. Could use modifiers and numbers or could use the same key to cycle through themes. Should also consider keyboard shortcuts for other settings, such as documentation mode and example code syntax. |
@kgryte, I would like to work on this enhancement, but before that, I would appreciate it if you could clarify something for me. Edit: I've noticed that using react-hotkeys-hook inside a class component requires a lot of patchwork. I will write my own logic instead. |
hello @kgryte, I could really use your input on something. Could you provide me with additional context regarding this package's changelog? Additionally, I need some guidance on setting up shortcuts for navigating to previous and next packages, since the usage of prop drillling appears extensive, I'm struggling to grasp its flow.
|
@lovelindhoni What are you wanting to know about the Changelog? For pagination, see https://github.com/stdlib-js/www/blob/master/src/components/readme/next.jsx and https://github.com/stdlib-js/www/blob/master/src/components/readme/prev.jsx. One possibility for implementing prev/next shortcuts is to have global keypress listeners which then simply trigger a click event on the respective links, thus triggering navigation. E.g., query the document for the element with the |
Thank you, @kgryte, I have nearly implemented all of the proposed keyboard shortcuts. In the help page, what else could it include besides keyboard shortcuts? If so, does the help page should be accessible to mobile users? |
For now just the keyboard shortcuts can be displayed in the help page. Re: mobile. We should probably disable keyboard shortcuts on mobile devices. |
- Implemented most of the keyboard shortcuts specified in stdlib-js#26 - Moved shortcuts prop and related methods to client.jsx - Made sure to not to overlap with the webaim keyboard shortcuts for web accessibility
- Implemented most of the keyboard shortcuts specified in stdlib-js#26 - Moved shortcuts prop and related methods to client.jsx - Made sure to not to overlap with the webaim keyboard shortcuts for web accessibility
Description
This RFC proposes adding support for keyboard shortcuts to the API documentation. Would be nice, e.g., to be able to open and close the side menu, to focus on the search input element, etc.
A list of possible keyboard shortcuts:
/
: focus on search (Algolia usedcmd + k
)fn + <-
: navigate to "previous" packagefn + ->
: navigate to "next" packagem
: toggle side menushift + f
: focus on side menu filter (similar tocmd + f
/ctrl + f
for browser find)shift + return
: run code example (once supported)?
: display help page (i.e., how to use the documentation, including keyboard shortcuts)b
: open benchmarks page (if exists)t
: open tests page (if exists)shift + t
: navigate to TypeScript docs (if exists)s
: navigate to source code (if exists)p
: navigate to package doc page (if, e.g., currently on a package's benchmarks page)c
: navigate to a package's changelog (if exists)d
: toggle dark mode (once supported)esc
: close search results/help/settings menuOthers?
Related Issues
No.
Questions
No.
Other
Checklist
RFC:
.The text was updated successfully, but these errors were encountered: