Package: docbook-to-man
Version: 1:2.0.0-48
Severity: minor
Tags: patch

   * What led up to the situation?

     Checking for defects with a new version

test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z < "man 
page"

  [Use 

grep -n -e ' $' -e '\\~$' -e ' \\f.$' -e ' \\"' <file>

  to find (most) trailing spaces.]

  ["test-groff" is a script in the repository for "groff"; is not shipped]
(local copy and "troff" slightly changed by me).

  [The fate of "test-nroff" was decided in groff bug #55941.]

   * What was the outcome of this action?
Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z 
":

an.tmac:<stdin>:54: style: .TH missing third argument; consider document 
modification date in ISO 8601 format (YYYY-MM-DD)
an.tmac:<stdin>:54: style: .TH missing fourth argument; consider 
package/project name and version (e.g., "groff 1.23.0")
troff:<stdin>:56: warning: trailing space in the line
[...]
troff:<stdin>:140: warning: trailing space in the line


   * What outcome did you expect instead?

     No output (no warnings).

-.-

  General remarks and further material, if a diff-file exist, are in the
attachments.


-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.21-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), 
LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages docbook-to-man depends on:
ii  docbook  4.5-11
ii  libc6    2.41-6
ii  opensp   1.5.2-15.2

docbook-to-man recommends no packages.

docbook-to-man suggests no packages.

-- no debconf information
Input file is docbook-to-man.1

Output from "mandoc -T lint  docbook-to-man.1": (shortened list)

      4 input text line longer than 80 bytes
      1 missing date, using ""
      6 skipping paragraph macro
     24 unsupported control character
      5 unsupported escape sequence
     88 whitespace at end of input line


Find trailing space with:
grep -n -e ' $' -e ' \\f.$' -e ' \\"' <man page>

-.-.

Output from
test-nroff -mandoc -t -ww -z docbook-to-man.1: (shortened list)

     60 line(s) with a trailing space


Find trailing space with:
grep -n -e ' $' -e ' \\f.$' -e ' \\"' <man page>

-.-.

Show if docman-to-man created this.

Who is actually creating this man page?  Debian or upstream?

Is the generating software out of date?

.\" created by instant / docbook-to-man, Fri 10 Sep 2004, 13:13 

-.-.

Remove space characters (whitespace) at the end of lines.
Use "git apply ... --whitespace=fix" to fix extra space issues, or use
global configuration "core.whitespace".

Number of lines affected is

90

-.-.

Reduce space between words.

docbook-to-man.1:56:docbook-to-man \(em convert \fBDocBook\fP       SGML into 
roff \-man macros 
docbook-to-man.1:59:\fBdocbook-to-man\fR [\fIsource.sgml\fR]  [>]  
[\fIdestination.1\fR]  
docbook-to-man.1:63:UNIX-style manpages from the \fBDocBook\fP SGML       DTD 
into nroff/troff \-man macros. 

-.-.

Use "\e" to print the escape character instead of "\\" (which gets
interpreted in copy mode).

87:Special characters like \\, ' or . will not be interpreted if you set 
INSTANT_OPT to a space or tab character. 

-.-.

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

93:e.g. if you want to use some special characters literally in 
103:> is to write them in the SGML way, i.e. &caret; 

-.-.

Wrong distance (not two spaces) 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.

Mark a final abbreviation point as such by suffixing it with "\&".

Some sentences (etc.) do not begin on a new line.

Split (sometimes) lines after a punctuation mark; before a conjunction.

  Lines with only one (or two) space(s) between sentences could be split,
so latter sentences begin on a new line.

Use

#!/usr/bin/sh

sed -e '/^\./n' \
-e 's/\([[:alpha:]]\)\.  */\1.\n/g' $1

to split lines after a sentence period.
Check result with the difference between the formatted outputs.
See also the attachment "general.bugs"

[List of affected lines removed.]

74:This manual page and some small changes are by W. Borgert 
83:If you want to use tabs in your manpage you should use <programlisting>, 
<literal> or <screen> and invoke docbook-to-man with INSTANT_OPT set to a tab 
character. Be aware that multiple tabs will be collapsed into one. 
87:Special characters like \\, ' or . will not be interpreted if you set 
INSTANT_OPT to a space or tab character. 
93:e.g. if you want to use some special characters literally in 
103:> is to write them in the SGML way, i.e. &caret; 

-.-.

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.
Add "\:" to split the string for the output, "\<newline>" in the source.  

Line 63, length 89

UNIX-style manpages from the \fBDocBook\fP SGML       DTD into nroff/troff 
\-man macros. 

Line 83, length 218

If you want to use tabs in your manpage you should use <programlisting>, 
<literal> or <screen> and invoke docbook-to-man with INSTANT_OPT set to a tab 
character. Be aware that multiple tabs will be collapsed into one. 

Line 85, length 124

When you want to collapse white space into one, you should invoke 
docbook-to-man with INSTANT_OPT set to a space character. 

Line 87, length 111

Special characters like \\, ' or . will not be interpreted if you set 
INSTANT_OPT to a space or tab character. 

Longest line is: 218 characters.
Longest line is number 83 with 218 characters
If you want to use tabs in your manpage you should use <programlisting>, 
<literal> or <screen> and invoke docbook-to-man with INSTANT_OPT set to a tab 
character. Be aware that multiple tabs will be collapsed into one. 

-.-.

The name of a man page is typeset in bold and the section in roman
(see man-pages(7)).

91:\fBinstant(1)\fR is called with the parameter 
140:instant(1) and transpec(5) 

-.-.

Remove quotes when there is a printable
but no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.

docbook-to-man.1:54:.TH "docbook-to-man" "1" 
docbook-to-man.1:55:.SH "NAME" 
docbook-to-man.1:57:.SH "SYNOPSIS" 
docbook-to-man.1:60:.SH "DESCRIPTION" 
docbook-to-man.1:88:.SH "ENVIRONMENT" 
docbook-to-man.1:105:.SH "COPYRIGHT" 

-.-.

Space character after a macro call.

54:.TH "docbook-to-man" "1" 
55:.SH "NAME" 
57:.SH "SYNOPSIS" 
58:.PP 
60:.SH "DESCRIPTION" 
61:.PP 
64:.PP 
70:.PP 
73:.PP 
81:.SH "White space and special characters" 
82:.PP 
84:.PP 
86:.PP 
88:.SH "ENVIRONMENT" 
89:.PP 
96:.PP 
101:.PP 
105:.SH "COPYRIGHT" 
106:.PP 
108:.PP 
110:.PP 
119:.PP 
123:.PP 
132:.PP 
138:.SH "See also" 
139:.PP 

-.-.

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

an.tmac:<stdin>:54: style: .TH missing third argument; consider document 
modification date in ISO 8601 format (YYYY-MM-DD)
an.tmac:<stdin>:54: style: .TH missing fourth argument; consider 
package/project name and version (e.g., "groff 1.23.0")
troff:<stdin>:56: warning: trailing space in the line
troff:<stdin>:59: warning: trailing space in the line
troff:<stdin>:62: warning: trailing space in the line
troff:<stdin>:63: warning: trailing space in the line
troff:<stdin>:65: warning: trailing space in the line
troff:<stdin>:66: warning: trailing space in the line
troff:<stdin>:67: warning: trailing space in the line
troff:<stdin>:68: warning: trailing space in the line
troff:<stdin>:69: warning: trailing space in the line
troff:<stdin>:71: warning: trailing space in the line
troff:<stdin>:72: warning: trailing space in the line
troff:<stdin>:74: warning: trailing space in the line
troff:<stdin>:75: warning: trailing space in the line
troff:<stdin>:76: warning: trailing space in the line
troff:<stdin>:77: warning: trailing space in the line
troff:<stdin>:78: warning: trailing space in the line
troff:<stdin>:79: warning: trailing space in the line
troff:<stdin>:80: warning: trailing space in the line
troff:<stdin>:83: warning: trailing space in the line
troff:<stdin>:85: warning: trailing space in the line
troff:<stdin>:87: warning: trailing space in the line
troff:<stdin>:90: warning: trailing space in the line
troff:<stdin>:91: warning: trailing space in the line
troff:<stdin>:92: warning: trailing space in the line
troff:<stdin>:93: warning: trailing space in the line
troff:<stdin>:94: warning: trailing space in the line
troff:<stdin>:95: warning: trailing space in the line
troff:<stdin>:97: warning: trailing space in the line
troff:<stdin>:98: warning: trailing space in the line
troff:<stdin>:99: warning: trailing space in the line
troff:<stdin>:102: warning: trailing space in the line
troff:<stdin>:103: warning: trailing space in the line
troff:<stdin>:104: warning: trailing space in the line
troff:<stdin>:107: warning: trailing space in the line
troff:<stdin>:109: warning: trailing space in the line
troff:<stdin>:111: warning: trailing space in the line
troff:<stdin>:112: warning: trailing space in the line
troff:<stdin>:113: warning: trailing space in the line
troff:<stdin>:114: warning: trailing space in the line
troff:<stdin>:115: warning: trailing space in the line
troff:<stdin>:116: warning: trailing space in the line
troff:<stdin>:117: warning: trailing space in the line
troff:<stdin>:118: warning: trailing space in the line
troff:<stdin>:120: warning: trailing space in the line
troff:<stdin>:121: warning: trailing space in the line
troff:<stdin>:122: warning: trailing space in the line
troff:<stdin>:124: warning: trailing space in the line
troff:<stdin>:125: warning: trailing space in the line
troff:<stdin>:126: warning: trailing space in the line
troff:<stdin>:127: warning: trailing space in the line
troff:<stdin>:128: warning: trailing space in the line
troff:<stdin>:129: warning: trailing space in the line
troff:<stdin>:130: warning: trailing space in the line
troff:<stdin>:131: warning: trailing space in the line
troff:<stdin>:133: warning: trailing space in the line
troff:<stdin>:134: warning: trailing space in the line
troff:<stdin>:135: warning: trailing space in the line
troff:<stdin>:136: warning: trailing space in the line
troff:<stdin>:137: warning: trailing space in the line
troff:<stdin>:140: warning: trailing space in the line

-.-.

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.
--- docbook-to-man.1    2025-04-20 15:52:01.911542325 +0000
+++ docbook-to-man.1.new        2025-04-20 16:21:34.605673105 +0000
@@ -49,93 +49,93 @@
 .ds f2\"
 .ds f3\"
 .ds f4\"
-'\" t 
-.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n  
-.TH "docbook-to-man" "1" 
-.SH "NAME" 
-docbook-to-man \(em convert \fBDocBook\fP       SGML into roff \-man macros 
-.SH "SYNOPSIS" 
-.PP 
-\fBdocbook-to-man\fR [\fIsource.sgml\fR]  [>]  [\fIdestination.1\fR]  
-.SH "DESCRIPTION" 
-.PP 
-The docbook-to-man tool is a batch converter that transforms 
-UNIX-style manpages from the \fBDocBook\fP SGML       DTD into nroff/troff 
\-man macros. 
-.PP 
-docbook-to-man is the shell command that runs the low-level 
-components to translate a single \fBDocBook\fP SGML document 
-instance (whose document element is <RefEntry>) into 
-pretty-much vanilla \-man macros, with tables rendered in 
-tbl. 
-.PP 
-This is not the original version by Fred Dalrymple, but one 
-with the ANS Modifications by David Bolen (d...@ans.net). 
-.PP 
-This manual page and some small changes are by W. Borgert 
-deba...@debian.org for \fBDebian GNU/Linux\fP.  Permission is 
-granted to copy, distribute and/or modify this document under 
-the terms of the GNU Free Documentation 
-License, Version 1.1 or any later version published by the Free 
-Software Foundation; with no Invariant Sections, no Front-Cover 
-Texts and no Back-Cover Texts. 
-.SH "White space and special characters" 
-.PP 
-If you want to use tabs in your manpage you should use <programlisting>, 
<literal> or <screen> and invoke docbook-to-man with INSTANT_OPT set to a tab 
character. Be aware that multiple tabs will be collapsed into one. 
-.PP 
-When you want to collapse white space into one, you should invoke 
docbook-to-man with INSTANT_OPT set to a space character. 
-.PP 
-Special characters like \\, ' or . will not be interpreted if you set 
INSTANT_OPT to a space or tab character. 
-.SH "ENVIRONMENT" 
-.PP 
-If the variable INSTANT_OPT is not set, the 
-\fBinstant(1)\fR is called with the parameter 
-\fB\-d\fP by docbook-to-man.  If you don't want this, 
-e.g. if you want to use some special characters literally in 
-your SGML file, you can set INSTANT_OPT to just 
-a space character:  
-.PP 
-\fBINSTANT_OPT=" 
-" docbook-to-man src.sgml > 
-dst.1\fR 
-. 
-.PP 
-Note: The better way to use special characters like ^ or 
-> is to write them in the SGML way, i.e. &caret; 
-or &gt;. 
-.SH "COPYRIGHT" 
-.PP 
-Copyright (c) 1996 X Consortium 
-.PP 
-Copyright (c) 1996 Dalrymple Consulting 
-.PP 
-Permission is hereby granted, free of charge, to any person 
-obtaining a copy of this software and associated documentation 
-files (the "Software"), to deal in the Software without 
-restriction, including without limitation the rights to use, 
-copy, modify, merge, publish, distribute, sublicense, and/or 
-sell copies of the Software, and to permit persons to whom the 
-Software is furnished to do so, subject to the following 
-conditions: 
-.PP 
-The above copyright notice and this permission notice shall 
-be included in all copies or substantial portions of the 
-Software. 
-.PP 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 
-KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 
-WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 
-AND NONINFRINGEMENT.  IN NO EVENT SHALL THE X CONSORTIUM OR 
-DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
-USE OR OTHER DEALINGS IN THE SOFTWARE. 
-.PP 
-Except as contained in this notice, the names of the X 
-Consortium and Dalrymple Consulting shall not be used in 
-advertising or otherwise to promote the sale, use or other 
-dealings in this Software without prior written 
-authorization. 
-.SH "See also" 
-.PP 
-instant(1) and transpec(5) 
-.\" created by instant / docbook-to-man, Fri 10 Sep 2004, 13:13 
+'\" t
+.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n
+.TH docbook-to-man 1
+.SH NAME
+docbook-to-man \(em convert \fBDocBook\fP SGML into roff \-man macros
+.SH SYNOPSIS
+\fBdocbook-to-man\fR [\fIsource.sgml\fR] [>] [\fIdestination.1\fR]
+.SH DESCRIPTION
+The docbook-to-man tool is a batch converter that transforms
+UNIX-style manpages from the \fBDocBook\fP SGML DTD into nroff/troff
+\-man macros.
+.PP
+docbook-to-man is the shell command that runs the low-level
+components to translate a single \fBDocBook\fP SGML document
+instance (whose document element is <RefEntry>) into
+pretty-much vanilla \-man macros, with tables rendered in
+tbl.
+.PP
+This is not the original version by Fred Dalrymple, but one
+with the ANS Modifications by David Bolen (d...@ans.net).
+.PP
+This manual page and some small changes are by W.\& Borgert
+deba...@debian.org for \fBDebian GNU/Linux\fP.  Permission is
+granted to copy, distribute and/or modify this document under
+the terms of the GNU Free Documentation
+License, Version 1.1 or any later version published by the Free
+Software Foundation; with no Invariant Sections, no Front-Cover
+Texts and no Back-Cover Texts.
+.SH White space and special characters
+If you want to use tabs in your manpage you should use <programlisting>,
+<literal> or <screen>
+and invoke docbook-to-man with INSTANT_OPT set to a tab character.
+Be aware that multiple tabs will be collapsed into one.
+.PP
+When you want to collapse white space into one,
+you should invoke docbook-to-man with INSTANT_OPT set to a space character.
+.PP
+Special characters like \e, ' or .\& will not be interpreted
+if you set INSTANT_OPT to a space or tab character.
+.SH ENVIRONMENT
+If the variable INSTANT_OPT is not set, the
+\fBinstant\fR(1) is called with the parameter
+\fB\-d\fP by docbook-to-man.  If you don't want this,
+e.g.\& if you want to use some special characters literally in
+your SGML file, you can set INSTANT_OPT to just
+a space character:
+.PP
+\fBINSTANT_OPT="
+" docbook-to-man src.sgml >
+dst.1\fR
+.
+.PP
+Note: The better way to use special characters like ^ or
+> is to write them in the SGML way, i.e.\& &caret;
+or &gt;.
+.SH COPYRIGHT
+Copyright (c) 1996 X Consortium
+.PP
+Copyright (c) 1996 Dalrymple Consulting
+.PP
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+.PP
+The above copyright notice and this permission notice shall
+be included in all copies or substantial portions of the
+Software.
+.PP
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
+AND NONINFRINGEMENT.  IN NO EVENT SHALL THE X CONSORTIUM OR
+DALRYMPLE CONSULTING BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+.PP
+Except as contained in this notice, the names of the X
+Consortium and Dalrymple Consulting shall not be used in
+advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written
+authorization.
+.SH See also
+.BR instant "(1) and " transpec (5)
+.\" created by instant / docbook-to-man, Fri 10 Sep 2004, 13:13
  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>

  To find trailing space use

grep -n -e ' $' -e ' \\f.$' -e ' \\"' <man page>

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

  For a style guide use

  mandoc -T lint

-.-

  Any "autogenerator" should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.

  It should also check its input files for too long (> 80) lines.

  This is just a simple quality control measure.

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

  Common defects:

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

  "git" has a "tool" to point out whitespace,
see for example "git-apply(1)" and git-config(1)")

  Not beginning each input sentence on a new line.
Line length and patch size should thus be reduced.

  The script "reportbug" uses 'quoted-printable' encoding when a line is
longer than 1024 characters in an 'ascii' file.

  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 -d -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 from 'diff -d -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)

-.-

Reply via email to