diff mbox series

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

Message ID ZyrJKT2g5m2jf5el@kassi.invalid.is (mailing list archive)
State New
Delegated to: Stephen Hemminger
Headers show
Series dcb-rewr.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. 6, 2024, 1:40 a.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-rewr.8": (possibly shortened list)

mandoc: dcb-rewr.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-rewr.8:76: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 \-\-

76: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
25:.RI DEV

-.-.

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.

129:.B -N
158:# dcb -N rewr show dev eth0 prio-dscp
168:# dcb rewr -N show dev eth0 prio-dscp

-.-.

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.

58:ID, and priority. Selector is an enumeration that picks one of the
59:prioritization namespaces. Currently, only the DSCP and PCP selector namespaces
64:assignment for the same selector and priority. For example, the set of two
74:commands. On the other hand, the command
84:Display all entries with a given selector. When no selector is given, shows all
89:Remove all entries with a given selector. When no selector is given, removes all
102:present in the rewrite table yet. Then remove those entries, whose selector and
104:protocol ID. This has the effect of, for the given selector and priority,
111:\fBadd\fR, \fBdel\fR and \fBreplace\fR commands. For \fBshow\fR and
119:for details. Keys are priorities, values are DSCP points for traffic
120:with matching priority. DSCP points can be written either directly as numeric
127:will similarly format DSCP values as symbolic names if possible. The
136:for details. Keys are priorities. Values are PCP/DEI for traffic with
137:matching priority. PCP/DEI values are written as a combination of numeric- and
138:symbolic values, to accommodate for both. PCP always in numeric form e.g 0 ..

-.-.

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

12:.RI "[ " OPTIONS " ] "

-.-.

Add missing period (.) for "e.g"

138:symbolic values, to accommodate for both. PCP always in numeric form e.g 0 ..
139:7 and DEI in symbolic form e.g 'de' (drop-eligible), indicating that the DEI

-.-.

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

diff --git a/dcb-rewr.8 b/dcb-rewr.8.new
index 03b59cf..c4c338f 100644
--- a/dcb-rewr.8
+++ b/dcb-rewr.8.new
@@ -3,26 +3,25 @@ 
 dcb-rewr \- show / manipulate the rewrite table of
 the DCB (Data Center Bridging) subsystem
 .SH SYNOPSIS
-.sp
 .ad l
 .in +8
 
 .ti -8
 .B dcb
-.RI "[ " OPTIONS " ] "
+.RI "[ " OPTIONS " ]"
 .B rewr
 .RI "{ " COMMAND " | " help " }"
 .sp
 
 .ti -8
 .B dcb rewr " { " show " | " flush " } " dev
-.RI DEV
+.I DEV
 .RB "[ " prio-dscp " ]"
 .RB "[ " prio-pcp " ]"
 
 .ti -8
 .B dcb rewr " { " add " | " del " | " replace " } " dev
-.RI DEV
+.I DEV
 .RB "[ " prio-dscp " " \fIDSCP-MAP\fB " ]"
 .RB "[ " prio-pcp " " \fIPCP-MAP\fB " ]"
 
@@ -30,13 +29,13 @@  the DCB (Data Center Bridging) subsystem
 .IR DSCP-MAP " := [ " DSCP-MAP " ] " DSCP-MAPPING
 
 .ti -8
-.IR DSCP-MAPPING " := " \fIPRIO \fB:\fR "{ " DSCP " | " \fBall\fR " }"
+.IR DSCP-MAPPING " := " "PRIO\fB:\fR" "{ " DSCP " | " \fBall\fR " }"
 
 .ti -8
 .IR PCP-MAP " := [ " PCP-MAP " ] " PCP-MAPPING
 
 .ti -8
-.IR PCP-MAPPING " := " \fIPRIO \fB:\fR PCP\fR
+.IR PCP-MAPPING " := " PRIO \fB:\fR PCP
 
 .ti -8
 .IR DSCP " := { " \fB0\fR " .. " \fB63\fR " }"
@@ -73,7 +72,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
 rewrite rule is in effect for a given selector and priority.
 
@@ -126,7 +125,7 @@  will only use the higher six bits).
 .B dcb rewr 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
@@ -135,8 +134,8 @@  turns the show translation off.
 .BR dcb (8)
 for details. Keys are priorities. Values are PCP/DEI for traffic with
 matching priority. PCP/DEI values are written as a combination of numeric- and
-symbolic values, to accommodate for both. PCP always in numeric form e.g 0 ..
-7 and DEI in symbolic form e.g 'de' (drop-eligible), indicating that the DEI
+symbolic values, to accommodate for both. PCP always in numeric 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 1:2de translates to a mapping of priority 1 to PCP=2 and DEI=1.
 
@@ -155,7 +154,7 @@  Add a rule to rewrite DSCP to 25 for traffic with priority 3:
 .br
 prio-dscp 0:0 3:CS3 3:25 6:CS6
 .br
-# dcb -N rewr show dev eth0 prio-dscp
+# dcb \-N rewr show dev eth0 prio-dscp
 .br
 prio-dscp 0:0 3:24 3:25 6:48
 
@@ -165,7 +164,7 @@  priority 3.
 .P
 # dcb rewr replace dev eth0 prio-dscp 3:26
 .br
-# dcb rewr -N show dev eth0 prio-dscp
+# dcb rewr \-N show dev eth0 prio-dscp
 .br
 prio-dscp 0:0 3:26 6:48