summaryrefslogtreecommitdiff
path: root/doc/utils/man2html.script
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2006-05-22 05:12:18 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2006-05-22 05:12:18 +0000
commitaa0f5b38aec14428b4b80e06f90ff781f8bca5f1 (patch)
tree95f3d0c8cb0d59d88900dbbd72110d7ab6e15b2a /doc/utils/man2html.script
parent7c383bc22113b23718be89fe18eeb251942d7356 (diff)
downloadvyos-strongswan-aa0f5b38aec14428b4b80e06f90ff781f8bca5f1.tar.gz
vyos-strongswan-aa0f5b38aec14428b4b80e06f90ff781f8bca5f1.zip
Import initial strongswan 2.7.0 version into SVN.
Diffstat (limited to 'doc/utils/man2html.script')
-rwxr-xr-xdoc/utils/man2html.script48
1 files changed, 48 insertions, 0 deletions
diff --git a/doc/utils/man2html.script b/doc/utils/man2html.script
new file mode 100755
index 000000000..515911c81
--- /dev/null
+++ b/doc/utils/man2html.script
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+# Assumes man2html command in path
+# That is a Perl script downloadable from
+# http://www.oac.uci.edu/indiv/ehood/man2html.html
+
+# also uses our man_xref utility
+
+case $# in
+2) ;;
+*) echo "Usage: $0 mantree destdir" >&2 ; exit 2 ;;
+esac
+
+mkdir -p $2
+rm -f $2/*
+
+# handle all sections just in case
+# only 3 5 8 expected
+for i in `find $1 -name 'ipsec*.[1-9]'`
+do
+ b=`basename $i`
+ # then parse that into section number s
+ # and name n
+ case $b in
+ *.1) s=1 ;;
+ *.2) s=2 ;;
+ *.3) s=3 ;;
+ *.4) s=4 ;;
+ *.5) s=5 ;;
+ *.6) s=6 ;;
+ *.7) s=7 ;;
+ *.8) s=8 ;;
+ *.9) s=9 ;;
+ *) echo "$0 has lost its mind" ; exit 1 ;;
+ esac
+ n=`basename $b \.$s`
+ # the echos are a kluge
+ # without them, the first section head is not tagged
+ (echo ; echo ; man $s $n ) | man2html > $2/$b.html
+done
+# man2html doesn't convert man page cross-references such as
+# ipsec.conf(5) into HTML links
+# So post-process to do that.
+for i in $2/*.html
+do
+ ../utils/man_xref $i > temp
+ mv temp $i
+done