OCaml 4.14.0 rebuild
[arch-packages.git] / docbook-utils / trunk / db2html
blobca94b82364bfc433a9e39efd4b7607bcb789a8cb
1 #! /bin/sh
3 ADMON_GRAPHICS=/usr/share/sgml/docbook/dsssl-stylesheets/images/*.gif
5 output=docbook2html-dir
6 skip=0
7 dbdircleanup=1
8 outputdone=0
9 for arg in "$@"
11 if [ $skip -gt 0 ]
12 then
13 skip=$(($skip - 1))
14 continue
16 case $arg in
17 -h|--help|-v|--version) break
19 -n|--nostd|-u|--nochunks) ;;
20 -o|--output) outputdone=1
23 -*) skip=1
25 *) dbdircleanup=0
26 if [ ${outputdone} -eq 1 ];
27 then
28 output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')"
29 outputfile="$basename "$output""
30 outputdone=2
31 elif [ ${outputdone} -eq 2 ];
32 then
33 outputfile="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,' | \
34 rev | cut -d'/' -f1 | rev)"
35 else
36 output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')"
37 outputfile=$(basename "$output")
40 esac
41 done
43 if [ ${dbdircleanup} -eq 0 ];
44 then
45 echo "Output is $output/$outputfile.html"
47 if [ -d ${output} ]
48 then
49 rm -rf ${output}.junk
50 mv ${output} ${output}.junk
52 mkdir ${output}
53 mkdir ${output}/stylesheet-images
54 cp ${ADMON_GRAPHICS} ${output}/stylesheet-images
55 jw -f docbook -b html -o ${output} "$@"
56 if [ ${dbdircleanup} -eq 1 ];
57 then
58 rm -rf ${output}