Releasing 1.9.
[gtk-doc.git] / gtkdoc-mkhtml.in
blobac420d6805b037e45a700d2bc33cda6e3feb41bc
1 #!/bin/sh
4 usage="\
5 Usage: gtkdoc-mkhtml MODULE DRIVER_FILE"
7 if test "x$1" = "x--version"; then
8 echo "@VERSION@"
9 exit 0
12 if test $# -ne 2; then
13 echo "${usage}" 1>&2
14 exit 1
17 module=$1
18 document=$2
20 # FIXME: this is a hack to run uninstalled
21 if test "x$0" = "x../../../../gtkdoc-mkhtml" ; then
22 # uninstalled
23 gtkdocdir=`dirname $0`
24 else
25 # installed
26 prefix=@prefix@
27 datarootdir=@datarootdir@
28 gtkdocdir=@datadir@/gtk-doc/data
31 declaration=$gtkdocdir/gtk-doc.dcl
33 if head -n 1 $document | grep "<?xml" > /dev/null; then
34 is_xml=true
35 else
36 is_xml=false
39 # Delete the old index.sgml file, if it exists.
40 if test -f index.sgml; then
41 rm -f index.sgml
44 if $is_xml; then
45 @XSLTPROC@ --nonet --xinclude \
46 --stringparam gtkdoc.bookname $module \
47 --stringparam gtkdoc.version "@VERSION@" \
48 $gtkdocdir/gtk-doc.xsl $document || exit $?
49 else
50 @JADE@ -t @SGML_FORMAT_TYPE@ -w no-idref -d $gtkdocdir/gtk-doc.dsl \
51 -V "gtkdoc-bookname=$module" -V "gtkdoc-version=@VERSION@" \
52 $gtkdocdir/gtk-doc.dcl $document || exit $?
55 # copy navigation images to html directory ...
56 cp -f $gtkdocdir/*.png .
57 cp -f $gtkdocdir/*.css .
60 echo "timestamp" > ../html.stamp