On Wed, Sep 13, 2017 at 9:23 AM Nicolas Goaziou wrote: > Hello, > > I would like to submit a new minor macro for integration within Org: the > "kbd" macro. > Awesome! > The "kbd" macro focuses on normalizing keybinding during export. For > example, during Texinfo export, {{{kbd(v SPC)}}} becomes > > @kbd{v @key{SPC}} > > whereas in another back-end, it becomes > > v > Can we have {{{kbd(v SPC)}}} export to below for HTML? v SPC It will be tremendously useful for blog posts. At the moment, I use this hack[1] in ox-hugo.el. *Also stuff within angle brackets will hide in HTML if you choose to leave the export as "v " for HTML too!* More specifically: > > Within {{{kbd(...)}}}, the following case-sensitive keys are wrapped > within angle brackets: SPC, RET, LFD, TAB, BS, ESC, DELETE, SHIFT, > CTRL, META, up, down, left, right. > > With an optional argument, it can wrap the key-binding within verbatim > or code markup: > > {{{kbd(v SPC,code)}}} => ~v ~ > > {{{kbd(v SPC,verbatim)}}} => =v = > Looks good. Granted, this is probably only useful for Texinfo export, but defining > it as a global macro makes Org documents a bit more portable across > export back-ends. > For HTML too! :) If there is any interest in it, I will add tests and documentation. > I attach a proof of concept. > +1 Copying Oleh, as I believe he would also have some interest in this. -- Kaushal Modi