diff options
Diffstat (limited to 'scripts/man_show_fixme.sh')
-rwxr-xr-x | scripts/man_show_fixme.sh | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/scripts/man_show_fixme.sh b/scripts/man_show_fixme.sh new file mode 100755 index 0000000..6a42b33 --- /dev/null +++ b/scripts/man_show_fixme.sh @@ -0,0 +1,55 @@ +#!/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 *\..*/) { + # FIXMES of the form "FIXME ." are "private" and + # ignored by this script + } else { + sub("FIXME[: ]*", "") + if ($0 ~ /^\.\\"[ ]*$/) { + + # If the FIXME line contains no additional text after + # "FIXME", then discard the blank line + + getline + } + print "" + if (fixme == 0) { + print ".TS" + print ".allbox;" + print "lbw52" + print "l." + print "FIXME" + print "T{" + } + fixme = 1 + } + } + + $0 !~ /^\.\\"/ && fixme == 1 { + fixme = 0 + print "T}" + print ".TE" + print "" + } + + fixme == 1 { + sub("^\\...[ ]", "") + sub("^\\...", "") + gsub("'"'"'", "\\(aq") + if ($0 ~ /^[ ][ ]*.*/) { + print ".br" + sub("^[ ]*", " ") + } + } + + { + print $0 + } + ' | tee "/tmp/$(basename $f).src" | man --nh --nj -l /dev/stdin +done |