summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authordzwdz2024-05-25 21:43:13 +0200
committerdzwdz2024-05-25 21:43:13 +0200
commit88726ea9830c7213a7d9c1965eba97d3987b87d5 (patch)
tree40f40648c604704e40d865e97564afe653f85115 /contrib
parent5b21be296ea2da40759a5ac0db9ab3eda686c744 (diff)
man: start writing manpages
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/man2html29
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