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