Update of /cvsroot/refdb/refdb/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29459/scripts
Modified Files:
Tag: Release_0_9_5_stable
runbib.in
Log Message:
added support for css file for sgml;remove prolog from TEI bibliography
Index: runbib.in
===================================================================
RCS file: /cvsroot/refdb/refdb/scripts/runbib.in,v
retrieving revision 1.14.2.3
retrieving revision 1.14.2.4
diff -u -U2 -r1.14.2.3 -r1.14.2.4
--- runbib.in 12 Sep 2004 21:08:10 -0000 1.14.2.3
+++ runbib.in 25 Sep 2004 21:21:01 -0000 1.14.2.4
@@ -13,7 +13,8 @@
# stylesheets
citlist="<myrefdblib>/dsssl/citations.dsl"
+makecss="<myrefdblib>/dsssl/makecss.dsl"
citlistx="<myrefdblib>/xsl/citations.xsl"
db2teix="<myrefdblib>/xsl/bibdb2tei.xsl"
-makecss="<myrefdblib>/xsl/makecss.xsl"
+makecssx="<myrefdblib>/xsl/makecss.xsl"
teihtml="<myrefdblib>/xsl/tei-refdb-xsl/tei-html/tei-refdb-html.xsl"
teifo="<myrefdblib>/xsl/tei-refdb-xsl/tei-fo/tei-refdb-fo.xsl"
@@ -80,5 +81,5 @@
local basename=${1%.*}
- $myxsltproc $makecss $1 > $basename.css
+ $myxsltproc $makecssx $1 > $basename.css
# todo: test whether $cssfile is an url
@@ -115,4 +116,24 @@
}
+mangledsssl ()
+{
+# refdb sends us a dsssl stylesheet. We need to create
+# a CSS file for all (x)html output. We first send the driver file through
+# a dsssl script to isolate the html section (otherwise we'd get another
+# definition for each variable from the print section), then grep for the
+# definitions, and convert them to css
+ local basename=${1%.*}
+
+ $myjade -t sgml -d $makecss $1 | grep "(define refdb-" | sed 's/(define refdb-text-indent \(.*\))/p.BIBLIOMIXED {text-indent: \1;}/ ; s/(define refdb-start-indent \(.*\))/p.BIBLIOMIXED {margin-left: \1;}/ ; s/(define refdb-font-size \(.*\))/p.BIBLIOMIXED {font-size: \1;}/' > $basename.css
+
+ if [ -n "$cssfile" ] && [ "$cssfile" != "$basename.css" ]; then
+ echo "sed 's&(define %stylesheet% #f)&(define %stylesheet% \"$cssfile\")&' < $1 > $basename.dsl$$" | sh
+ mv $basename.dsl$$ $basename.dsl
+ elif [ -s "$basename.css" ]; then
+ echo "sed 's&(define %stylesheet% #f)&(define %stylesheet% \"$basename.css\")&' < $1 > $basename.dsl$$" | sh
+ mv $basename.dsl$$ $basename.dsl
+ fi
+}
+
# read the command line options
while getopts ":d:E:G:hi:IN:p:S:t:u:w:" opt; do
@@ -212,4 +233,7 @@
fi
+ # need to create the css file
+ mangledsssl ${style%.}.dsl
+
### DocBook XML
elif [ $outtype = "db31x" ]; then
@@ -266,5 +290,7 @@
fi
- mv $basename.bib.xml.$$ $basename.bib.xml
+ # the bibliography carries its own prolog, comment it out
+ sed 's/\(<?xml.*\)/<!-- \1 -->/ ; s/\(<!DOCTYPE.*\)/<!-- \1 -->/' < $basename.bib.xml.$$ > $basename.bib.xml
+ rm $basename.bib.xml.$$
manglexsl ${style%.}.xsl "TEI"
|