Re: Format inline code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Michael,


After the discovery I made today (See thread '.RS':
https://lore.kernel.org/linux-man/eaee2c6e-cbb7-94b2-f6c4-9039d184e129@xxxxxxxxx/T/),

[.RS 4/.RE] is not an option.
It simply doesn't work in some contexts.

I propose using the same as before:

[[
.in +4n
.EX
// Code
.EE
.in
]]

There are some cases using [.nf/.fi] instead of [.EX/.EE].
I would replace those by [.EX/.EE].

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]).
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
.IP *
If
.B PERF_FORMAT_GROUP
was
.I not
specified:
.IP
.in +4n
.EX
struct read_format {
    u64 value;         /* The value of the event */
    u64 time_enabled;  /* if PERF_FORMAT_TOTAL_TIME_ENABLED */
    u64 time_running;  /* if PERF_FORMAT_TOTAL_TIME_RUNNING */
    u64 id;            /* if PERF_FORMAT_ID */
};
.EE
.in
]]

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


Your thoughts?


Thanks,

Alex



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux