man_show_fixme.sh: script to show FIXMEs in rendered man pages

A script that renders man pages with FIXMES as table
in rendered text.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2016-10-29 13:49:24 +02:00
parent 922077e0bb
commit 0524b5b9ac
1 changed files with 45 additions and 0 deletions

45
scripts/man_show_fixme.sh Normal file
View File

@ -0,0 +1,45 @@
#!/bin/sh
#
# Render man pages with FIXMEs shown as tables
# in the rendered page
#
for f in $*; do
cat $f | awk '
/^\.\\\" *FIXME/ {
if ($0 ~ /.*FIXME *\..*/) {
} else {
sub("FIXME[: ]*", "")
print ""
if (fixme == 0) {
print ".TS"
print ".allbox;"
print "lbw55"
print "l."
print "FIXME"
print "T{"
}
fixme = 1
}
}
$0 !~ /^\.\\\"/ && fixme == 1 {
fixme = 0
print "T}"
print ".TE"
print ""
}
fixme == 1 {
sub("^\\...[ ]", "")
sub("^\\...", "")
if ($0 ~ /^[ ][ ]*.*/) {
print ".br"
sub("^[ ]*", "")
}
}
{
print $0
}
' | tee "/tmp/$(basename $f).src" | man -l /dev/stdin
done