diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2023-08-25 21:35:47 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2023-08-25 21:35:47 -0700 |
| commit | a6fe02f46a93c8cfaad1a4cb3c5e166a7aea3a4b (patch) | |
| tree | 7bcbeeeac8e6a4409f9a2e6eaa3c7eacc607d49b /test/writer.ms | |
| parent | 0a298cb1bef39d9aa7d756b54aa360e43989431f (diff) | |
Man writer: improvements to code and code blocks.
The aim here (see #9020) is to produce more standard and more
portable man pages. To that end:
- We revert the fanciness introduced in #7506, which employs a
custom font name V and a macro that makes this act like boldface
in a terminal and monospace in other formats. Unfortunately,
this code uses a mechanism that is not portable (and does not
work in mandoc).
- Instead of using V for inline code, we simply use CR.
Note that `\f[CR]` is emitted instead of plain `\f[C]`,
because there is no C font in man. (This produces warnings
in recent versions of groff.)
- For code blocks, we now use the `.EX` and `.EE` macros,
together with `.IP` for spacing and indentation. This gives
more standard code that can be better interpreted e.g. by mandoc.
Diffstat (limited to 'test/writer.ms')
| -rw-r--r-- | test/writer.ms | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/writer.ms b/test/writer.ms index 32d7c1670..4b9b4d251 100644 --- a/test/writer.ms +++ b/test/writer.ms @@ -644,8 +644,8 @@ So is \f[B]\f[BI]this\f[B]\f[R] word. .PP So is \f[B]\f[BI]this\f[B]\f[R] word. .PP -This is code: \f[C]>\f[R], \f[C]$\f[R], \f[C]\[rs]\f[R], \f[C]\[rs]$\f[R], -\f[C]<html>\f[R]. +This is code: \f[CR]>\f[R], \f[CR]$\f[R], \f[CR]\[rs]\f[R], \f[CR]\[rs]$\f[R], +\f[CR]<html>\f[R]. .PP \m[strikecolor]This is \f[I]strikeout\f[R].\m[] .PP @@ -671,7 +671,7 @@ So is `pine.' .PP `He said, \[lq]I want to go.\[rq]' Were you alive in the 70\[cq]s? .PP -Here is some quoted `\f[C]code\f[R]' and a \[lq]\c +Here is some quoted `\f[CR]code\f[R]' and a \[lq]\c .pdfhref W -D "http://example.com/?foo=1&bar=2" -A "\c" \ -- "quoted link" \&\[rq]. @@ -707,7 +707,7 @@ Here\[cq]s one that has a line break in it: @alpha + omega times x sup 2@. .LP These shouldn\[cq]t be math: .IP \[bu] 3 -To get the famous equation, write \f[C]$e = mc\[ha]2$\f[R]. +To get the famous equation, write \f[CR]$e = mc\[ha]2$\f[R]. .IP \[bu] 3 $22,000 is a \f[I]lot\f[R] of money. So is $34,000. @@ -715,7 +715,7 @@ So is $34,000. .IP \[bu] 3 Shoes ($20) and socks ($5). .IP \[bu] 3 -Escaped \f[C]$\f[R]: $73 \f[I]this should be emphasized\f[R] 23$. +Escaped \f[CR]$\f[R]: $73 \f[I]this should be emphasized\f[R] 23$. .LP Here\[cq]s a LaTeX table: .HLINE @@ -938,7 +938,7 @@ Blockquoted: \c \& .QE .LP -Auto-links should not occur here: \f[C]<http://example.com/>\f[R] +Auto-links should not occur here: \f[CR]<http://example.com/>\f[R] .IP .nf \f[C] @@ -991,7 +991,7 @@ This is \f[I]easier\f[R] to type. Inline notes may contain \c .pdfhref W -D "http://google.com" -A "\c" \ -- "links" -\& and \f[C]]\f[R] verbatim characters, as well as [bracketed text]. +\& and \f[CR]]\f[R] verbatim characters, as well as [bracketed text]. .FE .QS .LP |
