Updated Spanish translation
[gtk-doc.git] / gtkdoc-mkhtml.in
blob13256fcdeb7e7070cb20244b16004b7ef08f555a
1 #!/bin/sh
4 usage() {
5 cat <<EOF
6 gtkdoc-mkhtml version @VERSION@ - generate documentation in html format
8 --verbose Print extra output while processing
9 --path=SEARCH_PATH Extra source directories
10 MODULE Name of the doc module being parsed
11 DRIVER_FILE File containing the toplevel DocBook file.
12 --version Print the version of this program
13 --help Print this help
14 EOF
17 # echo "args $*\n";
19 # parse options, ignore unknown options for future extensions
21 verbose="0"
22 searchpath=
23 uninstalled=no
24 while true; do
25 case "X$1" in
26 X--version) echo "@VERSION@"; exit 0;;
27 X--help) usage; exit 0;;
28 X--uninstalled) uninstalled=yes; shift;;
29 X--verbose) verbose="1"; shift;;
30 X--path=*) searchpath=`echo $1 | sed s/.*=//`; shift;;
31 X--*) shift;;
32 X*) break;;
33 esac
34 done
36 if test $# -lt 2; then
37 usage 1>&2
38 exit 1
41 module=$1
42 shift
43 document=$1
44 shift
46 quiet="1"
47 if test $verbose = "1"; then
48 quiet="0"
51 if test $uninstalled = yes; then
52 # this does not work from buiddir!=srcdir
53 gtkdocdir=`dirname $0`
54 # traditional Bourne shells may not support -e here, use -f
55 if test ! -f $gtkdocdir/gtk-doc.xsl; then
56 # try to src dir (set from makefiles) too
57 if test -f $ABS_TOP_SRCDIR/gtk-doc.xsl; then
58 gtkdocdir=$ABS_TOP_SRCDIR
61 styledir=$gtkdocdir/style
62 #echo "uninstalled, gtkdocdir=$gtkdocdir, cwd=$PWD"
63 else
64 # the first two are needed to resolve datadir
65 prefix=@prefix@
66 datarootdir=@datarootdir@
67 gtkdocdir=@datadir@/gtk-doc/data
68 styledir=$gtkdocdir
71 if head -n 1 $document | grep "<?xml" > /dev/null; then
72 is_xml=true
73 path_option='--path'
74 else
75 is_xml=false
76 path_option='--directory'
79 # we could do "$path_option $PWD "
80 # to avoid needing rewriting entities that are copied from the header
81 # into docs under xml
82 if test "X$searchpath" = "X"; then
83 path_arg=
84 else
85 path_arg="$path_option $searchpath"
88 # Delete the old index.sgml file, if it exists.
89 if test -f index.sgml; then
90 rm -f index.sgml
93 if $is_xml; then
94 #echo @XSLTPROC@ $path_arg --nonet --xinclude \
95 # --stringparam gtkdoc.bookname $module \
96 # --stringparam gtkdoc.version "@VERSION@" \
97 # "$@" $gtkdocdir/gtk-doc.xsl $document
98 @XSLTPROC@ $path_arg --nonet --xinclude \
99 --stringparam gtkdoc.bookname $module \
100 --stringparam gtkdoc.version "@VERSION@" \
101 --stringparam chunk.quietly $quiet \
102 --stringparam chunker.output.quiet $quiet \
103 "$@" $gtkdocdir/gtk-doc.xsl $document || exit $?
104 else
105 @JADE@ $path_arg -t @SGML_FORMAT_TYPE@ -w no-idref -d $gtkdocdir/gtk-doc.dsl \
106 -V "gtkdoc-bookname=$module" -V "gtkdoc-version=@VERSION@" \
107 "$@" $gtkdocdir/gtk-doc.dcl $document || exit $?
110 # copy navigation images and stylesheets to html directory ...
111 cp -f $styledir/*.png $styledir/*.css ./
114 echo "timestamp" > ../html.stamp