On Sun, Nov 09, 2025 at 11:52:59PM +0100, Preuße, Hilmar wrote:
> Control: submitter -1 [email protected]
>
> On 1/10/2021 9:12 PM, Bjarni Ingi Gislason wrote:
>
> Hello,
>
> > Dear Maintainer,
> >
> > the attachment contains a shell script to fix man pages created from
> > a docbook file.
> >
> Sorry, long response times.
>
> What do you expect me to do with that file? If the generator of a manual
I put some suggestions in the "general.bug" file in each reportbug
attachment.
> page file generates broken code it should be fixed, instead of writing a
> post processor, IMHO.
Postprocessing is a workaround until the defects are eliminated (both
upstream (the generator) and downstream (the input file). And if some
defects can not be eliminated, a postprocessing should be applied upstream
(downstream), that is _before_ delivery.
The producer (upstream) is accountable for its product.
> Is it still correct, that the manual pages generated from docbook still
> contain the errors you try to fix in the script?
>
I don't know. The sed-script was doing too much changes, so a reduced
version is following, but I have not used it.
#!/bin/sh
set -efu
# Skip lines with comments.
# Skip tables.
# Skip macro definitions
# Remove trailing spaces.
# Remove .PP after .SH and .SS.
# Remove trailing space after .SH or .SH
# Remove '\&' before a period inside or after a word.
# '\&' suppresses kerning between characters on both sides of it.
sed -e '/\\"/n' \
-e '/^\.TS,^\.TE/n' \
-e '/^\.de ,^\.\.$/n' \
-e 's/ *$//' \
-e '/^\.S[SH]/{n; /\.PP/d}' \
-e 's/ *$//' \
-e 's/\([^ ]\)\\&\./\1./g' \
${1:--}
N.B.
I got another e-mail at about the same time. I must have deleted it,
before saving e-mails.