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

Add key macro to identify a key reference or key combination #17

Open
GoogleCodeExporter opened this issue Jul 17, 2015 · 3 comments
Open

Comments

@GoogleCodeExporter
Copy link

A very common need for computer-related documentation is to reference a key or 
key combination on a keyboard. These references are often styled in the output 
to appear as keys on a keyboard. Without proper semantics in an AsciiDoc 
document, it's not possible to identify this information in the output.

I propose adding an inline key macro that recognizes the following syntax:

key:[Enter]
key:[Ctrl+Shift+T]
key:[Ctrl+N]

I'm also considering using the target slot for a single key reference:

key:Enter[]

We could consider using the attributes for the modifiers and the target for the 
final key, as in:

key:N[Ctrl]

...however, I'm quite certain documentation writers won't find that intuitive.

In the docbook backend, each key character is mapped to <keycap> and multiple 
keys are wrapped in <keycombo>.

<keycap>Enter</keycap>
<keycombo><keycap>Ctrl</keycap><keycap>N</keycap></keycombo>

In the html backend, these element names become class names on <span> elements.

I've included an implementation and a page that shows examples in a gist:

https://gist.github.com/mojavelinux/4736691

Original issue reported on code.google.com by dan.j.allen on 8 Feb 2013 at 5:11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant