diff options
author | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:43:39 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-10-10 17:43:39 +0200 |
commit | f4092abdf94af6a99aff944d6264bc1284e8bdd4 (patch) | |
tree | 2ac1c9cc16ceb93edb2c4382c088dac5aeafdf0f /nx-X11/extras/rman/contrib/man2html | |
parent | a840692edc9c6d19cd7c057f68e39c7d95eb767d (diff) | |
download | nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.tar.gz nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.tar.bz2 nx-libs-f4092abdf94af6a99aff944d6264bc1284e8bdd4.zip |
Imported nx-X11-3.1.0-1.tar.gznx-X11/3.1.0-1
Summary: Imported nx-X11-3.1.0-1.tar.gz
Keywords:
Imported nx-X11-3.1.0-1.tar.gz
into Git repository
Diffstat (limited to 'nx-X11/extras/rman/contrib/man2html')
-rw-r--r-- | nx-X11/extras/rman/contrib/man2html | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/nx-X11/extras/rman/contrib/man2html b/nx-X11/extras/rman/contrib/man2html new file mode 100644 index 000000000..3df77a3a8 --- /dev/null +++ b/nx-X11/extras/rman/contrib/man2html @@ -0,0 +1,108 @@ +#!/bin/ksh + +# Take a man tree and make an html tree out of it + +DOMAIN=$(domainname) +ARCH=$(arch) + +case ${DOMAIN} in + acf) localeo=reo1 ;; + bwfid) localeo=reo1 ;; + chfid) localeo=neo1 ;; + hkfid) localeo=teo1 ;; + lnfid) localeo=leo1 ;; + nyfid) localeo=neo1 ;; + psfid) localeo=leo1 ;; + sffid) localeo=neo1 ;; + tkfid) localeo=teo1 ;; + esac + +sections="{1,2,3,4,5,6,7,8}" +from=/usr/man +to=/u/eo/repository/system/unix/man + +function disambiguate +{ +newbase=${1} +newname="${newbase}.1" +dis=2 +while [ -a "${newname}" ] + do + newname=$newbase"."$dis + dis=$(expr $dis + 1) + done +} + +while getopts f:t:l:is:v c + do + case $c in + f) from=$OPTARG ;; + t) to=$OPTARG ;; + l) localeo=$OPTARG ;; + i) indexonly=1 ;; + s) sections=$OPTARG ;; + v) verbose=1 ;; + esac + done +shift OPTIND-1 + +if [ "${verbose}" ] + then + print "from: $from" + print "to: $to" + print "localeo: $localeo" + print "sections: $sections" + if [ "${indexonly}" ] + then + print "indexonly: 1" + fi + fi + +cd $from + +if [ ! "${indexonly}" ] + then + print "Processing the man pages ..." + for i in man${sections}/* + do + if [ "$verbose" ] + then + print $i + fi + # n=${i%.*} + name=${to}/${i} + if [ -a "${name}" ] + then + oldname=$name + disambiguate $name + name=$newname + print "Collision - ${oldname} will be stored as ${name}" + fi + eqn $i | tbl | nroff -man | rman -f HTML | sed -e "s/MS_LOCAL_HOST/${localeo}/g" > ${name} + done + fi + +print "Building the index.html files ..." +cd $to +for i in man${sections} + do + if [ "$verbose" ] + then + print $i + fi + cd $i + rm -f index.html + echo '<ul>' > ../new.html + for j in * + do + if [ "$verbose" ] + then + print -n "$j " + fi + print + print "<li> <a href=$j>$j</a>" >> ../new.html + done + echo '</ul>' >> ../new.html + mv ../new.html index.html + cd .. + done |