diff options
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/man2html | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/contrib/man2html b/contrib/man2html new file mode 100755 index 0000000..5dea876 --- /dev/null +++ b/contrib/man2html @@ -0,0 +1,29 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + echo usage: contrib/man2html outdir + exit +fi + +if [ ! -d $1 ]; then + echo $1 doesn\'t exist + exit +fi + +cat <<EOF > $1/index.html +<!DOCTYPE html> +<title>camellia manpages</title> +<ul> +EOF + +for path in man/*; do + echo $path + file=${path#man/} + name=${file%.*} + sec=${file#*.} + printf "<li><a href=\"$file.html\">$name($sec)</a> – " >> $1/index.html + sed -ne 's/^.Nd *//p' $path >> $1/index.html + echo "</li>" >> $1/index.html + mandoc -Tlint $path 2>&1 | grep -vE "mandoc.db|manual not found|operating system" + mandoc -Thtml -Ostyle=mandoc.css,man=%N.%S.html $path > $1/$file.html +done |