3 ## Customized version of db2html to make it easier to use alternate
4 ## stylesheets. Some versions of db2html support a '-d' option to
5 ## specify this, but not all. We'll explicitly specify that here.
7 ## John R. Sheets <jsheets@codeweavers.com>
9 ## Other possible SGML stylesheets (default Debian versions...may be
10 ## different on other distributions).
11 #DB_STYLESHEET=/usr/lib/sgml/stylesheet/dsssl/docbook/cygnus/cygnus-both.dsl
12 #DB_STYLESHEET=/usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/html/docbook.dsl
14 ## Use included default.dsl DSSSL stylesheet unless explicitly overridden with
15 ## the $WINEDOC_STYLESHEET envar.
17 ## NOTE: The invoked DSSSL stylesheet *MUST* have an HTML-specific section
18 ## in it; otherwise, jade will spew everything to stdout and fail to use
19 ## the stated stylesheet. Something like this:
21 ## <style-specification id="html" use="docbook">
22 if [ -z "$WINEDOC_STYLESHEET" ]; then
23 DB_STYLESHEET=../default.dsl
25 DB_STYLESHEET=$WINEDOC_STYLESHEET
29 TMPDIR=DBTOHTML_OUTPUT_DIR$$
31 echo TMPDIR is $TMPDIR
33 echo "Using stylesheet: \"${DB_STYLESHEET}\""
37 echo "Usage: `basename $0` [filename.sgml]" >&2
45 echo Cannot read \"$1\". Exiting. >&2
48 if echo $1 | egrep -i '\.sgml$|\.sgm$' >/dev/null 2>&1
50 # now make sure that the output directory is always a subdirectory
51 # of the current directory
53 input_file=`basename $1`
54 output="`echo $input_file | sed 's,\.sgml$,,;s,\.sgm$,,'`"
55 echo "input file was called $input_file -- output will be in $output"
62 if [ $1 = `basename $1` ]; then
63 echo "working on ../$1"
64 (cd $TMPDIR; jade -t sgml -ihtml -d ${DB_STYLESHEET}\#html ../$1; cd $SAVE_PWD)
67 (cd $TMPDIR; jade -t sgml -ihtml -d ${DB_STYLESHEET}\#html $1; cd $SAVE_PWD)
72 if [ -d ${output}.junk ]
74 /bin/rm -rf ${output}.junk
78 mv $output ${output}.junk
80 echo "about to rename temporary directory to $output"