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

kbd role should be a literal node #1534

Open
agoose77 opened this issue Sep 13, 2024 · 2 comments
Open

kbd role should be a literal node #1534

agoose77 opened this issue Sep 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@agoose77
Copy link
Contributor

I think my original implementation of the kbd role was mistaken to use a parent node. Instead, I think we should behave like a literal e.g. like chemicalFormula, inlineMath, etc.

@agoose77 agoose77 added the bug Something isn't working label Sep 13, 2024
@rowanc1
Copy link
Collaborator

rowanc1 commented Sep 24, 2024

We did this so we can support this:

<p>
  You can also create a new document using the
  <kbd><kbd>Ctrl</kbd>+<kbd>N</kbd></kbd> keyboard shortcut.
</p>

Which is in the MDN docs. Style could be improved, but that works (demo)!

@choldgraf
Copy link
Collaborator

I believe the way that sphinx distinguishes these is with the {guilabel} role, which is similar to kbd but doesn't do the "separating out" that {kbd} does (so {kbd}`a + b` becomes a separate a and b in the output)

https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-guilabel

Personally I have never been a fan of the naming because it's unnecessarily long to type for a role :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants