From d2bcf2d01c52b23fea69b1492d437404eb67f7ff Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 13 Apr 2021 21:15:04 -0700 Subject: doc: implement typesetting of keystrokes. This commit relies on parallel improvements in man2html, up through commit ac186529b6b5f80906c3215a67c98505db7bb156 "Implement .M2HT request for HTML passthrough." * genman.txr: Add CSS block targetting the kbd element, providing 3D styling for keyboard input. * txr.1: Define two new macros, .key and .keyn. These are defined in three different ways: in man page output, we put square brackets around keystrokes. In typeset groff output, we put a square border around them using a box macro cribbed from groff documentation. In HTML, we use .M2HT to wrap a tag around the keystrokes. Documentatio is updated to use these macros for all keystrokes. We no longer separate keystroke sequence elements with commas. --- genman.txr | 12 ++ txr.1 | 535 ++++++++++++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 435 insertions(+), 112 deletions(-) diff --git a/genman.txr b/genman.txr index 89aec557..07db7e04 100644 --- a/genman.txr +++ b/genman.txr @@ -194,6 +194,18 @@ dl.items dt { float: left; padding-right: 1ex; } +kbd { + background-color: #eee; + border-radius: 3px; + border: 1px solid #b4b4b4; + box-shadow: 0 1px 1px rgba(0, 0, 0, .2), 0 2px 0 0 rgba(255, 255, 255, .7) inset; + color: #333; + display: inline-block; + font-weight: 700; + line-height: 1; + padding: 2px 4px; + white-space: nowrap; +}