Add a long annotated parameter description (regression test for #613611)
[gtk-doc.git] / gtkdoc-mkhtml.in
blob9b09a88d1bc4f2a36c5c1dddb165e507a7b9aa2f
1 #!/bin/sh
4 usage="\
5 Usage: gtkdoc-mkhtml [--path=SEARCH_PATH] MODULE DRIVER_FILE [BACKEND_OPTIONS...]"
7 #echo "args $0\n";
9 # parse options, ignore unknown options for future extensions
11 searchpath=
12 uninstalled=no
13 while true; do
14 case "X$1" in
15 X--version) echo "@VERSION@"; exit 0;;
16 X--help) echo "$usage"; exit 0;;
17 X--uninstalled) uninstalled=yes; shift;;
18 X--path=*) searchpath=`echo $1 | sed s/.*=//`; shift;;
19 X--*) shift;;
20 X*) break;;
21 esac
22 done
24 if test $# -lt 2; then
25 echo "${usage}" 1>&2
26 exit 1
29 module=$1
30 shift
31 document=$1
32 shift
34 if test $uninstalled = yes; then
35 # this does not work from buiddir!=srcdir
36 # we could try this
37 # MAKE_SCRDIR=$(abs_srcdir) MAKE_BUILDDIR=$(abs_builddir) gtkdoc-mkhtml ...
38 gtkdocdir=`dirname $0`
39 #echo "uninstalled, gtkdocdir=$gtkdocdir"
40 else
41 # the first two are needed to resolve datadir
42 prefix=@prefix@
43 datarootdir=@datarootdir@
44 gtkdocdir=@datadir@/gtk-doc/data
47 if head -n 1 $document | grep "<?xml" > /dev/null; then
48 is_xml=true
49 path_option='--path'
50 else
51 is_xml=false
52 path_option='--directory'
55 # we could do "$path_option $PWD "
56 # to avoid needing rewriting entities that are copied from the header
57 # into docs under xml
58 if test "X$searchpath" = "X"; then
59 path_arg=
60 else
61 path_arg="$path_option $searchpath"
64 # Delete the old index.sgml file, if it exists.
65 if test -f index.sgml; then
66 rm -f index.sgml
69 if $is_xml; then
70 @XSLTPROC@ $path_arg --nonet --xinclude \
71 --stringparam gtkdoc.bookname $module \
72 --stringparam gtkdoc.version "@VERSION@" \
73 "$@" $gtkdocdir/gtk-doc.xsl $document || exit $?
74 else
75 @JADE@ $path_arg -t @SGML_FORMAT_TYPE@ -w no-idref -d $gtkdocdir/gtk-doc.dsl \
76 -V "gtkdoc-bookname=$module" -V "gtkdoc-version=@VERSION@" \
77 "$@" $gtkdocdir/gtk-doc.dcl $document || exit $?
80 # copy navigation images and stylesheets to html directory ...
81 cp -f $gtkdocdir/*.png .
82 cp -f $gtkdocdir/*.css .
85 echo "timestamp" > ../html.stamp