diff mbox series

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

Message ID ZyevP76CiK57k_CZ@kassi.invalid.is (mailing list archive)
State New, archived
Delegated to: Stephen Hemminger
Headers show
Series dcb-app.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. 3, 2024, 5:13 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_manual" should be in an 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-app.8": (possibly shortened list)

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

-.-.

Change two HYPHEN-MINUSES (code 0x2D) to an em-dash (\(em),
if one is intended.
  " \(em " creates a too big gap in the text (in "troff").

An en-dash is usually surrounded by a space,
while an em-dash is used without spaces.
"man" (1 byte characters in input) transforms an en-dash (\(en) to one
HYPHEN-MINUS,
and an em-dash to two HYPHEN-MINUSES without considering the space
around it.
If "--" are two single "-" (end of options) then use "\-\-".

dcb-app.8:111:does what one would typically want in this situation--first adds the new

-.-.

Change -- in x--y to \(em (em-dash), or, if an
option, to \-\-

111:does what one would typically want in this situation--first adds the new

-.-.

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

19:.RI DEV
30:.RI DEV

-.-.

Use a macro to change to the italic font, instead of \fI, if
possible (see man-pages(7)).
The macros have the italic corrections, but "\c" removes the "\/" part,
which is in the macro.
So "\/" must be added between the italic argument and the "\c" string.

  Or

add the italic corrections.

154:rules are configured as triplets (\fBEtherType\fR, \fB0\fR, \fIPRIO\fR).
162:\fIET-MAP\fR uses the array parameter syntax, see
173:\fIPORT-MAP\fR uses the array parameter syntax, see
181:\fIDSCP-MAP\fR uses the array parameter syntax, see
198:\fIPCP-MAP\fR uses the array parameter syntax, see

-.-.

Change a HYPHEN-MINUS (code 0x2D) to a minus(-dash) (\-),
if it
is in front of a name for an option,
is a symbol for standard input,
is a single character used to indicate an option,
or is in the NAME section (man-pages(7)).
N.B. - (0x2D), processed as a UTF-8 file, is changed to a hyphen
(0x2010, groff \[u2010] or \[hy]) in the output.

193:.B -N
223:# dcb -N app show dev eth0 dscp-prio
233:# dcb app -N show dev eth0 dscp-prio

-.-.

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.

93:value in the selector namespace. E.g. for EtherType selector, protocol IDs are

-.-.

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.

N.B.

  The number of lines affected can be too large to be in a patch.

85:Center Bridging) subsystem. The APP table is used to assign priority to traffic
87:DSCP. It also allows configuration of port-default priority that is chosen if no
90:DCB APP entries are 3-tuples of selector, protocol ID, and priority. Selector is
91:an enumeration that picks one of the prioritization namespaces. Currently it
92:mostly corresponds to configurable parameters described below. Protocol ID is a
93:value in the selector namespace. E.g. for EtherType selector, protocol IDs are
94:the individual EtherTypes, for DSCP they are individual code points. The
98:The APP table is a set of DCB APP entries. The only requirement is that
99:duplicate entries are not added. Notably, it is valid to have conflicting
100:priority assignment for the same selector and protocol ID. For example, the set
102:10 should get priority of both 1 and 2, form a well-defined APP table. The
109:commands. On the other hand, the command
119:Display all entries with a given selector. When no selector is given, shows all
124:Remove all entries with a given selector. When no selector is given, removes all
137:present in the APP table yet. Then remove those entries, whose selector and
139:priority. This has the effect of, for the given selector and protocol ID,
146:\fBadd\fR, \fBdel\fR and \fBreplace\fR commands. For \fBshow\fR and \fBflush\fR,
152:unspecified. The argument is a list of individual priorities. Note that
164:for details. Keys are EtherType values. Values are priorities to be assigned to
175:for details. Keys are L4 destination port numbers that match on, respectively,
176:TCP and SCTP traffic, UDP and DCCP traffic, and either of those. Values are
183:for details. Keys are DSCP points, values are priorities assigned to
184:traffic with matching DSCP. DSCP points can be written either directly as
191:will similarly format DSCP values as symbolic names if possible. The
200:for details. Keys are PCP/DEI. Values are priorities assigned to traffic with
201:matching PCP/DEI. PCP/DEI values are written as a combination of numeric- and
202:symbolic values, to accommodate for both. PCP always in numerical form e.g
203:0 .. 7 and DEI in symbolic form e.g 'de' (drop-eligible), indicating that the

-.-.

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

Output from "test-nroff  -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

diff --git a/dcb-app.8 b/dcb-app.8.new
index be505a0..dde3d28 100644
--- a/dcb-app.8
+++ b/dcb-app.8.new
@@ -3,20 +3,19 @@ 
 dcb-app \- show / manipulate application priority table of
 the DCB (Data Center Bridging) subsystem
 .SH SYNOPSIS
-.sp
 .ad l
 .in +8
 
 .ti -8
 .B dcb
-.RI "[ " OPTIONS " ] "
+.RI "[ " OPTIONS " ]"
 .B app
 .RI "{ " COMMAND " | " help " }"
 .sp
 
 .ti -8
 .B dcb app " { " show " | " flush " } " dev
-.RI DEV
+.I DEV
 .RB "[ " default-prio " ]"
 .RB "[ " ethtype-prio " ]"
 .RB "[ " stream-port-prio " ]"
@@ -27,7 +26,7 @@  the DCB (Data Center Bridging) subsystem
 
 .ti -8
 .B dcb app " { " add " | " del " | " replace " } " dev
-.RI DEV
+.I DEV
 .RB "[ " default-prio " " \fIPRIO-LIST\fB " ]"
 .RB "[ " ethtype-prio " " \fIET-MAP\fB " ]"
 .RB "[ " stream-port-prio " " \fIPORT-MAP\fB " ]"
@@ -90,7 +89,7 @@  other prioritization rule applies.
 DCB APP entries are 3-tuples of selector, protocol ID, and priority. Selector is
 an enumeration that picks one of the prioritization namespaces. Currently it
 mostly corresponds to configurable parameters described below. Protocol ID is a
-value in the selector namespace. E.g. for EtherType selector, protocol IDs are
+value in the selector namespace. E.g., for EtherType selector, protocol IDs are
 the individual EtherTypes, for DSCP they are individual code points. The
 priority is the priority that should be assigned to traffic that matches the
 selector and protocol ID.
@@ -108,7 +107,7 @@  and
 .B del
 commands. On the other hand, the command
 .B replace
-does what one would typically want in this situation--first adds the new
+does what one would typically want in this situation\(emfirst adds the new
 configuration, and then removes the obsolete one, so that only one
 prioritization is in effect for a given selector and protocol ID.
 
@@ -190,7 +189,7 @@  will only use the higher six bits).
 .B dcb app show
 will similarly format DSCP values as symbolic names if possible. The
 command line option
-.B -N
+.B \-N
 turns the show translation off.
 
 .TP
@@ -199,8 +198,8 @@  turns the show translation off.
 .BR dcb (8)
 for details. Keys are PCP/DEI. Values are priorities assigned to traffic with
 matching PCP/DEI. PCP/DEI values are written as a combination of numeric- and
-symbolic values, to accommodate for both. PCP always in numerical form e.g
-0 .. 7 and DEI in symbolic form e.g 'de' (drop-eligible), indicating that the
+symbolic values, to accommodate for both. PCP always in numerical form e.g.,
+0 .. 7 and DEI in symbolic form, e.g., 'de' (drop-eligible), indicating that the
 DEI bit is 1 or 'nd' (not-drop-eligible), indicating that the DEI bit is 0.
 In combination 2de:1 translates to a mapping of PCP=2 and DEI=1 to priority 1.
 
@@ -220,7 +219,7 @@  Add another rule to configure DSCP 24 to priority 2 and show the result:
 .br
 dscp-prio 0:0 CS3:2 CS3:3 CS6:6
 .br
-# dcb -N app show dev eth0 dscp-prio
+# dcb \-N app show dev eth0 dscp-prio
 .br
 dscp-prio 0:0 24:2 24:3 48:6
 
@@ -230,7 +229,7 @@  priority 4:
 .P
 # dcb app replace dev eth0 dscp-prio 24:4
 .br
-# dcb app -N show dev eth0 dscp-prio
+# dcb app \-N show dev eth0 dscp-prio
 .br
 dscp-prio 0:0 24:4 48:6