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

Suggestion: Using {kbd} role for keybindings #280

Open
melissawm opened this issue Nov 22, 2023 · 4 comments
Open

Suggestion: Using {kbd} role for keybindings #280

melissawm opened this issue Nov 22, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@melissawm
Copy link
Member

melissawm commented Nov 22, 2023

Now that keybindings are becoming more stable, would it be a good idea to use the {kbd} role for keys in documentation? For example, using the

{kbd}`ctrl`+{kbd}`z`

syntax shows this in the rendered docs:

Screenshot_20231122_163924

A few things to consider:

  • This is very black 😅 we may want to style those keybindings differently
  • The kbd role in both myst and sphinx may be styled differently from the rest of the literal/code rendering we have currently, so marking those keys makes it easier to change this in the future.
@psobolewskiPhD
Copy link
Member

We discussed this yesterday in the docs meeting. I'm a big fan of this. We just need to use {kbd}`letter` for shortcuts? and this will already work?
I don't love the black, but it is contrasty. I think I'd prefer something more subtle like a black outline and light grey? But this is for the theme to take care of right?
Eitherway, I think we should add this to the Docs contribution guide.

@melissawm
Copy link
Member Author

Correct on all counts - as long as we mark the key bindings with this syntax, the looks can be fixed later with some CSS on the theme side.

@jni
Copy link
Member

jni commented Nov 27, 2023

@melissawm I love this, but just to clarify, does {kbd}`Ctrl+Z` not work as expected? I find it jarring to have the + in the middle, rather than in the same expression. It would be great if the theme became smart enough to start rendering shortcuts in a platform-specific way, like the theme shortcuts themselves are:

Screenshot 2023-11-27 at 9 47 05 pm

But for that to work, the modifiers and the keys should be in the same expression.

But, either way, I love the idea. ❤️

@melissawm
Copy link
Member Author

Oh absolutely, we can do that! I can put in a proposal for both

  1. fixes for existing content, and
  2. a note in the style guide (and probably the PR template) about not forgetting to use this syntax for new shortcuts in the docs.

@melissawm melissawm moved this to Prioritized in Documentation Working Group Sep 26, 2024
@melissawm melissawm moved this from Prioritized to In progress in Documentation Working Group Nov 11, 2024
psobolewskiPhD added a commit that referenced this issue Dec 14, 2024
# References and relevant issues
Related to #280

# Description
Fixes a few typos, typesetting details.

Updates content for the viewer tutorial, including new gui elements.

Images will also need to be updated.

---------

Co-authored-by: Peter Sobolewski <[email protected]>
Co-authored-by: Draga Doncila Pop <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In progress
Development

No branches or pull requests

3 participants