summaryrefslogtreecommitdiff
path: root/man/lib/tohtml.sh
diff options
context:
space:
mode:
Diffstat (limited to 'man/lib/tohtml.sh')
-rw-r--r--man/lib/tohtml.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/man/lib/tohtml.sh b/man/lib/tohtml.sh
new file mode 100644
index 00000000..b3081a58
--- /dev/null
+++ b/man/lib/tohtml.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+if [ -e output ]; then
+ rm output -rf
+fi
+
+cwd=$(pwd)
+echo "CWD: ${cwd}"
+mkdir output
+for d in $(ls); do
+ if [ -d $d ]; then
+ if [ x"$d" = x"output" ]; then
+ continue
+ fi
+ if [ x"$d" = x"lib" ]; then
+ continue
+ fi
+ echo "mkdir output/${d}"
+ mkdir output/${d}
+ pushd $d
+ for f in $(ls); do
+ name=$(basename -- "$f")
+ ext="${name##*.}"
+ if [ x"${ext}" = x"html" ]; then
+ echo "Remove ${f}"
+ rm $f
+ else
+ cat ${f} | mandoc -Thtml | python3 ${cwd}/mklinks.py -p /man/ -o ${cwd}/output/$d/$f.html
+ #cat ${f} | mandoc -Thtml > ${cwd}/output/$d/$f.html
+ echo "Processed ${d}/${f}"
+ fi
+ done
+ popd
+ fi
+done