-
Notifications
You must be signed in to change notification settings - Fork 385
Description
Discussed in #13487
Originally posted by andrewheiss October 1, 2025
Description
The kbd shortcode is really helpful for formatting keyboard shortcuts across operating systems.
In Javascript-enabled outputs, it uses some fancy logic to replace keys with their macOS equivalents, so that Command becomes ⌘, and so on.
This is great for documents that can adapt to the reader's OS. For teaching with slideshows, though, it's a little trickier because the Javascript OS-detection can't be disabled.
For instance, suppose I have this revealjs slidehow:
---
title: "Cross-platform kbd"
format: revealjs
---
## Rendering
To render:
- macOS: {{< kbd Command-Shift-K >}}
- Windows: {{< kbd Ctrl-Shift-K >}}If I'm showing the slides in a classroom setting using a computer running macOS, the Windows shortcut displays as ^⇧K
Similarly, if I'm showing the slides from a computer with Windows, the macOS shortcut displays as Command-Shift-K
As far as I can tell, there's no way to use the kbd shortcode to get output like this:
It might be helpful for teaching purposes to have a setting/option for the kbd shortcode to disable to OS detection