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 ## The DocBook installations behave differently for the various Linux
10 ## distributions. Try to make some sense out of it all....
12 ## $LINUXDIST holds the name of the distribution
13 ## $JADETAG adds "/#html" to the stylesheet-specification in the Jade
14 ## command line (see comments below), if necessary for that dist.
15 if [ -a /etc/debian_version ]; then
20 if [ -a /etc/redhat_release ]; then
25 ## FIXME: Add more distributions here...
27 if [ -n "$LINUXDIST" ]; then
28 echo "Using db2html parameters for a $LINUXDIST Linux distribution..."
31 ## Use included default.dsl DSSSL stylesheet unless explicitly overridden with
32 ## the $WINEDOC_STYLESHEET envar.
34 ## NOTE: The invoked DSSSL stylesheet *MUST* have an HTML-specific section
35 ## in it; otherwise, jade will spew everything to stdout and fail to use
36 ## the stated stylesheet. Something like this:
38 ## <style-specification id="html" use="docbook">
39 if [ -z "$WINEDOC_STYLESHEET" ]; then
40 DB_STYLESHEET=../default.dsl
42 DB_STYLESHEET=$WINEDOC_STYLESHEET
46 TMPDIR=DBTOHTML_OUTPUT_DIR$$
48 echo TMPDIR is $TMPDIR
50 echo "Using stylesheet: \"${DB_STYLESHEET}\""
54 echo "Usage: `basename $0` [filename.sgml]" >&2
62 echo Cannot read \"$1\". Exiting. >&2
65 if echo $1 | egrep -i '\.sgml$|\.sgm$' >/dev/null 2>&1
67 # now make sure that the output directory is always a subdirectory
68 # of the current directory
69 input_file=`basename $1`
70 output="`echo $input_file | sed 's,\.sgml$,,;s,\.sgm$,,'`"
71 echo "input file was called $input_file -- output will be in $output"
78 if [ $1 = `basename $1` ]; then
84 JADE_CMD="jade -t sgml -ihtml -d ${DB_STYLESHEET}${JADETAG} ${EXTRA_PATH}$1"
85 echo "Invoking command '$JADE_CMD'"
88 echo "working on ${EXTRA_PATH}$1"
89 (cd $TMPDIR; $JADE_CMD; cd $SAVE_PWD)
93 if [ -d ${output}.junk ]
95 /bin/rm -rf ${output}.junk
99 mv $output ${output}.junk
101 echo "about to rename temporary directory to $output"