diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:40:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:40:15 +0000 |
commit | 399644e47874bff147afb19c89228901ac39340e (patch) | |
tree | 1c4c0b733f4c16b5783b41bebb19194a9ef62ad1 /scripts/man_show_fixme.sh | |
parent | Initial commit. (diff) | |
download | manpages-399644e47874bff147afb19c89228901ac39340e.tar.xz manpages-399644e47874bff147afb19c89228901ac39340e.zip |
Adding upstream version 6.05.01.upstream/6.05.01
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 |