Bug#1088708: anytopnm.1: Some remarks and editorial changes for this man page

Bjarni Ingi Gislason bjarniig at simnet.is
Fri Nov 29 19:37:40 GMT 2024


Package: netpbm
Version: 2:11.08.01-1+b1
Severity: minor
Tags: patch

   * What led up to the situation?

     Checking for defects with

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

  [Use "groff -e ' $' <file>" to find 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?


troff: backtrace: file '<stdin>':11
troff:<stdin>:11: warning: name 'UN' not defined
troff: backtrace: file '<stdin>':77
troff:<stdin>:77: 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.11.10-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 netpbm depends on:
ii  libc6            2.40-3
ii  libjpeg62-turbo  1:2.1.5-3+b1
ii  libnetpbm11t64   2:11.08.01-1+b1
ii  libpng16-16t64   1.6.44-2
ii  libtiff6         4.5.1+git230720-5
ii  libx11-6         2:1.8.10-2
ii  libxml2          2.12.7+dfsg+really2.9.14-0.2+b1
ii  zlib1g           1:1.3.dfsg+really1.3.1-1+b1

Versions of packages netpbm recommends:
ii  ghostscript  10.04.0~dfsg-1

netpbm suggests no packages.

-- no debconf information
-------------- next part --------------
Input file is anytopnm.1

  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  anytopnm.1 ": (shortened list)

      3 skipping paragraph macro
      1 skipping unknown macro
      1 whitespace at end of input line

-.-.

Output from "test-groff -mandoc -t -ww -b -z anytopnm.1 ": (shortened list)

      1 name 'UN' not defined
      1 trailing space in the line

-.-.

Output from "mandoc -T lint  anytopnm.1 ":

mandoc: anytopnm.1:11:2: ERROR: skipping unknown macro: .UN synopsis
mandoc: anytopnm.1:19:2: WARNING: skipping paragraph macro: PP after SH
mandoc: anytopnm.1:72:2: WARNING: skipping paragraph macro: PP after SH
mandoc: anytopnm.1:77:33: STYLE: whitespace at end of input line
mandoc: anytopnm.1:100:2: WARNING: skipping paragraph macro: PP empty
-.-.

Lines containing '\c' (' \c' does not make sense):

21:.BR "Netpbm" (1)\c
85:.BR "pamfile" (1)\c
87:.BR "pnm" (1)\c

-.-.

Remove space characters at the end of lines.

Use "git apply ... --whitespace=fix" to fix extra space issues, or use
global configuration "core.whitespace".

77:programs based on libnetpbm (See 

-.-.

Remove space in the first column, if not indented.
Use ".in +<number>n" and ".in" to end it; ".nf" and ".fi" to end
it, for an extra indention.

anytopnm.1:79: Common Options

-.-.

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.

9:anytopnm - convert an arbitrary type of image file to PBM, PGM, or PPM
57:If \fIfile\fP is \fB-\fP or not given, \fBanytopnm\fP takes its
81:\&.)  However, the \fB-version\fP option works.

-.-.

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.

30:fragment included with Netpbm). If that fails (very few image formats

-.-.

Test nr. 32:

Use \(en (en-dash) for a dash between space characters,
not a minus (\-) or a hyphen (-), except in the NAME section.

anytopnm.1:9:anytopnm - convert an arbitrary type of image file to PBM, PGM, or PPM

-.-.

Put a parenthetical sentence, phrase on a separate line,
if not part of a code.
See man-pages(7), item "semantic newline".

anytopnm.1:66:images starting with Netpbm 10.69 (December 2014), but only the first in

-.-.

Two or more space charaters between printable characters.

When the distance is between sentences,
start the beginning of the second one on a separate line
("semantic newline", see man-pages(7)).

3:.\" Do not hand-hack it!  If you have bug fixes or improvements, please find
38:you couldn't convert with some other Netpbm program.  What
40:the appropriate Netpbm program to convert it.  For example, if you
60:Many image formats are capable of representing multiple images.  In
81:\&.)  However, the \fB-version\fP option works.
97:source.  The master documentation is at

-.-.

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

troff: backtrace: file '<stdin>':11
troff:<stdin>:11: warning: name 'UN' not defined
troff: backtrace: file '<stdin>':77
troff:<stdin>:77: warning: trailing space in the line

-.-.

  Additionally:

The URL "index.html#commonoptions" is not complete.
-------------- next part --------------
--- anytopnm.1	2024-11-29 16:36:48.637149910 +0000
+++ anytopnm.1.new	2024-11-29 19:32:56.493238046 +0000
@@ -6,20 +6,18 @@
 .TH "Anytopnm User Manual" 1 "15 November 2014" "netpbm documentation"
 
 .SH NAME
-anytopnm - convert an arbitrary type of image file to PBM, PGM, or PPM
+anytopnm \- convert an arbitrary type of image file to PBM, PGM, or PPM
 
-.UN synopsis
+.\".UN synopsis
 .SH SYNOPSIS
 
 \fBanytopnm\fP [\fIfile\fP]
 
 
-.UN description
+.\".UN description
 .SH DESCRIPTION
-.PP
 This program is part of
-.BR "Netpbm" (1)\c
-\&.
+.BR "Netpbm" (1).
 .PP
 \fBanytopnm\fP converts the input image, which may be in any of
 about 100 graphics formats, to PBM, PGM, or PPM format, depending on
@@ -54,7 +52,7 @@ If \fBfile\fP indicates that the input f
 or btoa, \fBanytopnm\fP decodes it and proceeds as above with the
 decoded result.
 .PP
-If \fIfile\fP is \fB-\fP or not given, \fBanytopnm\fP takes its
+If \fIfile\fP is \fB\-\fP or not given, \fBanytopnm\fP takes its
 input from Standard Input.
 .PP
 Many image formats are capable of representing multiple images.  In
@@ -67,20 +65,20 @@ images starting with Netpbm 10.69 (Decem
 earlier releases.
 
 
-.UN options
+.\".UN options
 .SH OPTIONS
-.PP
 There are no command line options defined specifically
 for \fBanytopnm\fP.
 
 \fBanytopnm\fP does not recognize the options common to all
-programs based on libnetpbm (See 
+programs based on libnetpbm.
+(See
 .UR index.html#commonoptions
- Common Options
-.UE
-\&.)  However, the \fB-version\fP option works.
+Common Options
+.UE .)
+However, the \fB\-version\fP option works.
 
-.UN seealso
+.\".UN seealso
 .SH SEE ALSO
 .BR "pamfile" (1)\c
 \&,
@@ -88,7 +86,7 @@ programs based on libnetpbm (See
 \&,
 \fBfile\fP man page
 
-.UN author
+.\".UN author
 .SH AUTHOR
 
 Copyright (C) 1991 by Jef Poskanzer.
@@ -97,4 +95,3 @@ This manual page was generated by the Ne
 source.  The master documentation is at
 .IP
 .B http://netpbm.sourceforge.net/doc/anytopnm.html
-.PP


More information about the Pkg-phototools-devel mailing list