diff mbox series

dcb-buffer.8: some remarks and editorial changes for this manual

Message ID ZypN2Fv_tBCT_AY2@kassi.invalid.is (mailing list archive)
State New
Headers show
Series dcb-buffer.8: some remarks and editorial changes for this manual | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Bjarni Ingi Gislason Nov. 5, 2024, 4:54 p.m. UTC
The man page is from Debian:

Package: iproute2
Version: 6.11.0-1
Severity: minor
Tags: patch

  Improve the layout of the man page according to the "man-page(7)"
guidelines, the output of "mandoc -lint T", the output of
"groff -mandoc -t -ww -b -z", that of a shell script, and typographical
conventions.

-.-

  Output from a script "chk_man" is in the attachment.

-.-

Signed-off-by: Bjarni Ingi Gislason <bjarniig@simnet.is>
Any program (person), that produces man pages, should check the output
for defects by using (both groff and nroff)

[gn]roff -mandoc -t -ww -b -z -K utf8  <man page>

  The same goes for man pages that are used as an input.

  For a style guide use

  mandoc -T lint

-.-

  So any 'generator' should check its products with the above mentioned
'groff', 'mandoc',  and additionally with 'nroff ...'.

  This is just a simple quality control measure.

  The 'generator' may have to be corrected to get a better man page,
the source file may, and any additional file may.

  Common defects:

  Input text line longer than 80 bytes.

  Not removing trailing spaces (in in- and output).
  The reason for these trailing spaces should be found and eliminated.

  Not beginning each input sentence on a new line.
Lines should thus be shorter.

  See man-pages(7), item 'semantic newline'.

-.-

The difference between the formatted output of the original and patched file
can be seen with:

  nroff -mandoc <file1> > <out1>
  nroff -mandoc <file2> > <out2>
  diff -u <out1> <out2>

and for groff, using

"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - "

instead of 'nroff -mandoc'

  Add the option '-t', if the file contains a table.

  Read the output of 'diff -u' with 'less -R' or similar.

-.-.

  If 'man' (man-db) is used to check the manual for warnings,
the following must be set:

  The option "-warnings=w"

  The environmental variable:

export MAN_KEEP_STDERR=yes (or any non-empty value)

  or

  (produce only warnings):

export MANROFFOPT="-ww -b -z"

export MAN_KEEP_STDERR=yes (or any non-empty value)

-.-.

Output from "mandoc -T lint dcb-buffer.8": (possibly shortened list)

mandoc: dcb-buffer.8:6:2: WARNING: skipping paragraph macro: sp after SH

-.-.


Change (or include a "FIXME" paragraph about) misused SI (metric)
numeric prefixes (or names) to the binary ones, like Ki (kibi), Mi
(mebi), Gi (gibi), or Ti (tebi), if indicated.
If the metric prefixes are correct, add the definitions or an
explanation to avoid misunderstanding.

96:Set sizes of all buffers to 10KB, except for buffer 6, which will have the size
100:# dcb buffer set dev eth0 buffer-size all:10K 6:1M
109:buffer-size 0:10Kb 1:10Kb 2:10Kb 3:10Kb 4:10Kb 5:10Kb 6:1Mb 7:10Kb
111:total-size 1222Kb

-.-.

Use the correct macro for the font change of a single argument or
split the argument into two.

19:.RI DEV
26:.RI DEV

-.-.

Add a comma (or \&) after "e.g." and "i.e.", or use English words
(man-pages(7)).
Abbreviation points should be protected against being interpreted as
an end of sentence, if they are not, and that independent of the
current place on the line.

61:i.e. as used with the \fBset\fR command. For the \fBshow\fR command, the

-.-.

Wrong distance between sentences in the input file.

  Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

  The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.

Remember coding: Only one command ("sentence") on each (logical) line.

E-mail: Easier to quote exactly the relevant lines.

Generally: Easier to edit the sentence.

Patches: Less unaffected text.

Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.

  The amount of space between sentences in the output can then be
controlled with the ".ss" request.

55:priority, and sizes of those buffers. It can be also used to inspect the current
61:i.e. as used with the \fBset\fR command. For the \fBshow\fR command, the
62:parameter name is to be used as a simple keyword without further arguments. This
63:instructs the tool to show the value of a given parameter. When no parameters
69:buffers. This might be more than a simple sum of individual buffer sizes if
76:for details. Keys are priorities, values are buffer indices. For each priority
83:for details. Keys are buffer indices, values are sizes of that buffer in bytes.

-.-.

Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.


Line 49, length 82

.IR SIZE " := { " INTEGER " | " INTEGER\fBK\fR " | " INTEGER\fBM\fR " | " ... " }"


-.-.

Use the name of units in text; use symbols in tables and
calculations.
The rule is to have a (no-break, \~) space between a number and
its units (see "www.bipm.org/en/publications/si-brochure")

100:# dcb buffer set dev eth0 buffer-size all:10K 6:1M
109:buffer-size 0:10Kb 1:10Kb 2:10Kb 3:10Kb 4:10Kb 5:10Kb 6:1Mb 7:10Kb
111:total-size 1222Kb

-.-.

No space is needed before a quote (") at the end of a line

12:.RI "[ " OPTIONS " ] "

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -ww -b -z ":

troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':709: macro 'RI'
troff: backtrace: file '<stdin>':12
troff:<stdin>:12: warning: trailing space in the line
diff mbox series

Patch

--- dcb-buffer.8	2024-11-05 00:32:12.449059896 +0000
+++ dcb-buffer.8.new	2024-11-05 01:01:52.385065995 +0000
@@ -3,27 +3,26 @@ 
 dcb-buffer \- show / manipulate port buffer settings of
 the DCB (Data Center Bridging) subsystem
 .SH SYNOPSIS
-.sp
 .ad l
 .in +8
 
 .ti -8
 .B dcb
-.RI "[ " OPTIONS " ] "
+.RI "[ " OPTIONS " ]"
 .B buffer
 .RI "{ " COMMAND " | " help " }"
 .sp
 
 .ti -8
 .B dcb buffer show dev
-.RI DEV
+.I DEV
 .RB "[ " prio-buffer " ]"
 .RB "[ " buffer-size " ]"
 .RB "[ " total-size " ]"
 
 .ti -8
 .B dcb buffer set dev
-.RI DEV
+.I DEV
 .RB "[ " prio-buffer " " \fIPRIO-MAP " ]"
 .RB "[ " buffer-size " " \fISIZE-MAP " ]"
 
@@ -46,35 +45,43 @@  the DCB (Data Center Bridging) subsystem
 .IR BUFFER " := { " \fB0\fR " .. " \fB7\fR " }"
 
 .ti -8
-.IR SIZE " := { " INTEGER " | " INTEGER\fBK\fR " | " INTEGER\fBM\fR " | " ... " }"
+.IR SIZE " := { " INTEGER " | " INTEGER\fBK\fR " | " INTEGER\fBM\fR " | " \
+\&... " }"
 
 .SH DESCRIPTION
 
 .B dcb buffer
 is used to configure assignment of traffic to port buffers based on traffic
-priority, and sizes of those buffers. It can be also used to inspect the current
-configuration, as well as total device memory that the port buffers take.
+priority, and sizes of those buffers.
+It can be also used to inspect the current configuration,
+as well as total device memory that the port buffers take.
 
 .SH PARAMETERS
 
 For read-write parameters, the following describes only the write direction,
-i.e. as used with the \fBset\fR command. For the \fBshow\fR command, the
-parameter name is to be used as a simple keyword without further arguments. This
-instructs the tool to show the value of a given parameter. When no parameters
-are given, the tool shows the complete buffer configuration.
+i.e., as used with the \fBset\fR command.
+For the \fBshow\fR command,
+the parameter name is to be used as a simple keyword without further
+arguments.
+This instructs the tool to show the value of a given parameter.
+When no parameters are given,
+the tool shows the complete buffer configuration.
 
 .TP
 .B total-size
 A read-only property that shows the total device memory taken up by port
-buffers. This might be more than a simple sum of individual buffer sizes if
+buffers.
+This might be more than a simple sum of individual buffer sizes if
 there are any hidden or internal buffers.
 
 .TP
 .B prio-buffer \fIPRIO-MAP
 \fIPRIO-MAP\fR uses the array parameter syntax, see
 .BR dcb (8)
-for details. Keys are priorities, values are buffer indices. For each priority
-sets a buffer where traffic with that priority is directed to.
+for details.
+Keys are priorities, values are buffer indices.
+For each priority sets a buffer where traffic with that priority is directed
+to.
 
 .TP
 .B buffer-size \fISIZE-MAP
@@ -93,8 +100,8 @@  Configure the priomap in a one-to-one fa
 .P
 # dcb buffer set dev eth0 prio-buffer 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
 
-Set sizes of all buffers to 10KB, except for buffer 6, which will have the size
-1MB:
+Set sizes of all buffers to 10\~kibibytes (KiB),
+except for buffer 6, which will have the size 1\~mebibyte (MiB):
 
 .P
 # dcb buffer set dev eth0 buffer-size all:10K 6:1M