Blame SOURCES/db2html

b9ab89
#! /bin/sh
b9ab89
b9ab89
ADMON_GRAPHICS=/usr/share/sgml/docbook/dsssl-stylesheets/images/*.gif
b9ab89
b9ab89
output=docbook2html-dir
b9ab89
skip=0
b9ab89
dbdircleanup=1
b9ab89
outputdone=0
b9ab89
for arg in "$@"
b9ab89
do
b9ab89
  if [ $skip -gt 0 ]
b9ab89
  then
b9ab89
    skip=$(($skip - 1))
b9ab89
    continue
b9ab89
  fi
b9ab89
  case $arg in
b9ab89
  -h|--help|-v|--version)	break
b9ab89
				;;
b9ab89
  -n|--nostd|-u|--nochunks)	;;
b9ab89
  -o|--output)   outputdone=1
b9ab89
	         ;;
b9ab89
b9ab89
  -*)				skip=1
b9ab89
				;;
b9ab89
  *)    dbdircleanup=0
b9ab89
        if [ ${outputdone} -eq 1 ];
b9ab89
        then
b9ab89
          output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')"
b9ab89
          outputfile="$basename "$output""
b9ab89
          outputdone=2
b9ab89
        elif [ ${outputdone} -eq 2 ];
b9ab89
        then
b9ab89
          outputfile="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,' | \
b9ab89
                      rev | cut -d'/' -f1 | rev)"
b9ab89
        else
b9ab89
          output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')"
b9ab89
          outputfile=$(basename "$output")
b9ab89
        fi
b9ab89
	;;
b9ab89
  esac
b9ab89
done
b9ab89
b9ab89
if [ ${dbdircleanup} -eq 0 ];
b9ab89
then
b9ab89
  echo "Output is $output/$outputfile.html"
b9ab89
fi
b9ab89
if [ -d ${output} ]
b9ab89
then
b9ab89
  rm -rf ${output}.junk
b9ab89
  mv ${output} ${output}.junk
b9ab89
fi
b9ab89
mkdir ${output}
b9ab89
mkdir ${output}/stylesheet-images
b9ab89
cp ${ADMON_GRAPHICS} ${output}/stylesheet-images
b9ab89
jw -f docbook -b html -o ${output} "$@"
b9ab89
if [ ${dbdircleanup} -eq 1 ];
b9ab89
then
b9ab89
  rm -rf ${output}
b9ab89
fi