[Aptitude-devel] Bug#979736: man pages: manuals created from a docbook file need postprocessing
    Bjarni Ingi Gislason 
    bjarniig at rhi.hi.is
       
    Sun Jan 10 23:07:57 GMT 2021
    
    
  
Package: aptitude-common
Version: 0.8.13-2
Severity: minor
Dear Maintainer,
  the attachment contains a shell script to fix man pages created from
a docbook file.
  Main improvements are:
# Remove trailing spaces.
# Remove .PP after .SH and .SH.
# Remove '\&' before a period inside or after a word.
#  '\&' suppresses kerning between characters on both sides of it.
# Break lines after a punctuation mark and before a parentheses.
#  To make lines shorter and easier to read, edit, and make a diff.
sed -e '/\\"/n' \
  -e '/^\.TS,^\.TE/n' \
  -e 's/  *$//' \
  -e '/^\.S[SH]/{n; /\.PP/d}' \
  -e 's/\([^ ]\)\\&\./\1./g' \
  -e 's/\([^ ][.,;!?]\)  */\1\n/g' \
  -e 's/ (/\n(/g' ${1:--}
  An example is "aptitude-create-state-bundle.1".
-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 5.10.4-1 (SMP w/2 CPU threads)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
aptitude-common depends on no packages.
Versions of packages aptitude-common recommends:
ii  aptitude  0.8.13-2+b1
aptitude-common suggests no packages.
-- no debconf information
-- 
Bjarni I. Gislason
-------------- next part --------------
#!/bin/sh
set -efu
# Skip lines with comments.
# Skip tables.
# Remove trailing spaces.
# Remove .PP after .SH and .SH.
# Remove '\&' before a period inside or after a word.
#  '\&' suppresses kerning between characters on both sides of it.
# Break lines after a punctuation mark, before a parentheses.
#  To make lines shorter and easier to edit and diff.
sed -e '/\\"/n' \
  -e '/^\.TS,^\.TE/n' \
  -e 's/  *$//' \
  -e '/^\.S[SH]/{n; /\.PP/d}' \
  -e 's/\([^ ]\)\\&\./\1./g' \
  -e 's/\([^ ][.,;!?]\)  */\1\n/g' \
  -e 's/ (/\n(/g' ${1:--}
    
    
More information about the Aptitude-devel
mailing list