linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
To: Alejandro Colomar <colomar.6.4.3@gmail.com>
Cc: mtk.manpages@gmail.com, linux-man <linux-man@vger.kernel.org>
Subject: Re: Format inline code
Date: Fri, 13 Nov 2020 19:28:01 +1100	[thread overview]
Message-ID: <20201113082759.vqeufvucqg3agdhh@localhost.localdomain> (raw)
In-Reply-To: <bb5f3aad-d766-fb9e-e77a-09009fb7b599@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2477 bytes --]

At 2020-11-12T22:17:34+0100, Alejandro Colomar wrote:
> There are some cases using [.nf/.fi] instead of [.EX/.EE].
> I would replace those by [.EX/.EE].

Yes!  I strongly encourage this, and recently finished fixing all of
groff's man pages (about 60 of them) to clear the last vestiges of
.nf/.fi.

> However, I would still do the change [.IP] -> [(.RS + .PP)/.RE],
> so almost always you'll have [.PP] surrounding code examples,
> and you'll only see [.IP] when it is really needed:
> in cases where you use its argument ([.IP * n]).

I think this is a good idea, too.  As I have tried to explain in
groff_man(7)--at some length because this issue bedeviled me a long
time--the "relative inset" macros should really be thought of separately
from paragraph indentation.  In a way it is regrettable that the default
indent for paragraphs is different from the increment used for relative
insets; if they were different, the distinction would be much more
obvious to people.  But perhaps not, in the end, much less frustrating.

If you'd like to give me some feedback on the subsections "Horizontal
and vertical spacing" and the .RS-related item in section "Notes" in
groff_man_style(7), I'd appreciate it.

	https://man7.org/linux/man-pages/man7/groff_man_style.7.html

> In those cases, you should also use [.IP] for the code
> (see perf_event_open.2:1426):
> 
> [[
> .IP * 2
> If
> .B PERF_FORMAT_GROUP
> was specified to allow reading all events in a group at once:
> .IP
> .in +4n
> .EX
> struct read_format {
>     u64 nr;            /* The number of events */
>     u64 time_enabled;  /* if PERF_FORMAT_TOTAL_TIME_ENABLED */
>     u64 time_running;  /* if PERF_FORMAT_TOTAL_TIME_RUNNING */
>     struct {
>         u64 value;     /* The value of the event */
>         u64 id;        /* if PERF_FORMAT_ID */
>     } values[nr];
> };
> .EE
> .in

Have you considered changing out this .IP/.in/.EX/.../.EE/.in pattern
for .RS/.PP/.EX/.../.EX ?

I'm attaching two fake man pages based on the above content, following
each approach.  The _only_ difference is in the man page footer, to make
it easy to see which approach is used.

> This way, inline code, and only inline code, will use [.in],
> which will help grepping if it is ever needed.

Don't .EX and .EE serve just as well for this?  I regret to say I'm not
as familiar with the man-pages corpus as I should be, so I could be
wrong.

Regards,
Branden

[-- Attachment #1.2: alex.man --]
[-- Type: application/x-troff-man, Size: 990 bytes --]

[-- Attachment #1.3: alex-branden.man --]
[-- Type: application/x-troff-man, Size: 991 bytes --]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-11-13  8:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 10:19 Format inline code Alejandro Colomar
2020-11-05 11:36 ` Michael Kerrisk (man-pages)
2020-11-05 14:59   ` Alejandro Colomar
2020-11-05 21:37     ` Michael Kerrisk (man-pages)
2020-11-05 22:01       ` Alejandro Colomar
2020-11-06  9:38         ` Alejandro Colomar
2020-11-06 16:00           ` Michael Kerrisk (man-pages)
2020-11-06 16:36             ` Alejandro Colomar
2020-11-08 12:22               ` Michael Kerrisk (man-pages)
2020-11-12 11:32                 ` Alejandro Colomar
2020-11-12 21:17                 ` Alejandro Colomar
2020-11-13  8:28                   ` G. Branden Robinson [this message]
2020-11-13  9:00                     ` Michael Kerrisk (man-pages)
2020-11-13  9:47                       ` G. Branden Robinson
2020-11-13 10:11                         ` Michael Kerrisk (man-pages)
2020-11-13 10:21                       ` Alejandro Colomar
     [not found]                 ` <fbaf2a56-3f2e-e5ce-6ca2-e8f30156947d@gmail.com>
2020-11-12 21:20                   ` Alejandro Colomar
2020-11-12 22:55                     ` [RFC v1] perf_event_open.2: srcfix + ffix Alejandro Colomar
2020-11-13  9:21                       ` Michael Kerrisk (man-pages)
2020-11-13 10:26                         ` Alejandro Colomar
2020-11-13 10:39                           ` Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201113082759.vqeufvucqg3agdhh@localhost.localdomain \
    --to=g.branden.robinson@gmail.com \
    --cc=colomar.6.4.3@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).