docbook-utils/db2html
2011-11-25 09:41:18 +01:00

41 lines
737 B
Bash
Executable File

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