Open tajmone opened 3 years ago
inline node for keystrokes
Yes, that's one more of the nodes to add soon (after the new parser is ready). Thanks.
A first syntax that comes to mind:
single key:
[key Z]
key combination:
[key Ctrl,Shift,Z] // no space and no + between
[key Ctrl, Shift, Z] // space between
[key Ctrl+Shift+Z] // + between
Needs more thought before implementing. Suggestions are very welcome.
Thanks a lot for the useful links too.
It would be useful to have an inline node for keystrokes, to generate the
<kbd>
HTML tag.Possible node tags:
[key
or just[k
.Example:
which would be rendered as:
Ctrl Shift Z
with HTML code:
(see below for an alternative node syntax)
Note that in the above example I've inserted spaces between the keys, but many people don't, while others insert the
+
symbol:rendered as:
CtrlShiftZ
Ctrl+Shift+Z
... it's a matter of personal taste, but it should be kept into account in the implementation.
Multi-Keys Node
Also, not how Asciidoctor implements it via the Keyboard Macro:
(rendered as: Ctrl+Shift+Z)
It's smart because it uses just one keyword to handle multiple keys, using
+
as a separator (two pluses+ +
will produce the+
key).So PML could also do that, and instead of the above proposed implementation, could instead:
CSS Styling
For some nice styling of the keys via ready-to-us CSS stylesheets, see:
IMO, the first link offers the best CSS effects for keys, and also provided different styles.
The second on is beautiful looking, but maybe not so practical for inline styling (keys are too big).