nolebase / integrations

✍️ A collection of diverse documentation engineering tools. Better reading experience, inline link preview, highlight targeted title, enhanced <mark> element, state-of-the-art SEO and <meta> generation, og image, thumbhash & blurhash images and more!
https://nolebase-integrations.ayaka.io
MIT License
149 stars 28 forks source link

feature request: shortcut markup for <kbd> elements #24

Open nekomeowww opened 11 months ago

nekomeowww commented 11 months ago

Currently the experience of writing <kbd> elements and nested <kbd> elements for keystrokes when documenting key bindings are causing headaches.

Can we introduce some of the currently using markup for <kbd> and port them into markdown-it by looking up the rehype, remark and micromark communities?

Ampernic commented 7 months ago

This would be great, since when trying to use markdown-it-kbd and bi-directional-links at the same time - the latter starts cluttering the log with attempts to parse kbd as bi-directional syntax.

nekomeowww commented 7 months ago

[!NOTE] In Nolebase, I directly use <kbd data-macos-keyboard-key="command">command</kbd> + <kbd data-keyboard-key="space">space</kbd> markup along with the CSS styles I manually tweaked for VitePress to make it possible to attach icons and logos for the keys.

These are the known markups I know for sure to look into: