This is the mail archive of the
docbook-tools-discuss@sourceware.cygnus.com
mailing list for the docbook-tools project.
new db2html script
- To: Mark Galassi <rosalia@nis.lanl.gov>, docbook-discuss <docbook-tools-discuss@sourceware.cygnus.com>
- Subject: new db2html script
- From: "David C. Mason" <dcm@redhat.com>
- Date: 10 Aug 1999 15:14:33 -0400
I started to work on an addition to the db2html script (which can then
be extended to the others I just chose db2html for the hell of it). What
I am trying to do is give an option of passing a different stylesheet
into jade. You can find the addition below.
The way I have it now is the same as it is currently (even with the
${DB_STYLESHEET} variable being hard-coded at the top) but with the
added parameter "-d" which is followed by the stylesheet. So the user
would type:
db2html -d /path/to/mystylesheet.dsl myfile.sgml
OK, it works fine for me because I have already removed the \#html
part in the line that calls jade. The problem arises when you are
using a stylesheet such as cygnus-both.dsl that has both html and
print. One option is to have \#html or \#print in the stylesheet
name... E.g.,
DB_STYLESHEET=/usr/lib/sgml/stylesheets/cygnus-both.dsl\#html but that
may not be readily apparent to the user who downloads a cool
stylesheet and can't get it to work because he/she hasn't put \#html
on the end.
What do you guys think? Is there a better way to handle this? Should
we not hardcode \#html and \#print in the script? Do you guys like my
addition?
My addition:
##########################
case $1 in
-d) DB_STYLESHEET=${2?; shift;;}\
shift 2
esac
echo "Using stylesheet: \"${DB_STYLESHEET}\""
##########################
If you want to try it out add the lines above starting at line 11. You
will need to get rid of "\#html" in lines 45 or 47 unless your
stylesheet needs it.
Cheers,
Dave
--
David Mason
Red Hat AD Labs
dcm@redhat.com