File: gtkdoc-mkhtml.in

package info (click to toggle)
gtk-doc 1.15-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 5,576 kB
  • ctags: 266
  • sloc: xml: 16,117; sh: 10,619; perl: 7,967; ansic: 509; makefile: 434; lisp: 137
file content (90 lines) | stat: -rw-r--r-- 2,185 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/sh
#

usage="\
Usage: gtkdoc-mkhtml [--path=SEARCH_PATH] MODULE DRIVER_FILE [BACKEND_OPTIONS...]"

#echo "args $0\n";

# parse options, ignore unknown options for future extensions

searchpath=
uninstalled=no
while true; do
    case "X$1" in
        X--version) echo "@VERSION@"; exit 0;;
        X--help) echo "$usage"; exit 0;;
        X--uninstalled) uninstalled=yes; shift;;
        X--path=*) searchpath=`echo $1 | sed s/.*=//`; shift;;
        X--*) shift;;
        X*) break;;
    esac
done
 
if test $# -lt 2; then
      echo "${usage}" 1>&2
      exit 1
fi

module=$1
shift
document=$1
shift

if test $uninstalled = yes; then
      # this does not work from buiddir!=srcdir
      gtkdocdir=`dirname $0`
      if test ! -e $gtkdocdir/gtk-doc.xsl; then
        # try to src dir (set from makefiles) too
        if test -e $ABS_TOP_SRCDIR/gtk-doc.xsl; then
          gtkdocdir=$ABS_TOP_SRCDIR
        fi
      fi
      #echo "uninstalled, gtkdocdir=$gtkdocdir, cwd=$PWD"
else
      # the first two are needed to resolve datadir
      prefix=@prefix@
      datarootdir=@datarootdir@
      gtkdocdir=@datadir@/gtk-doc/data
fi

if head -n 1 $document | grep "<?xml" > /dev/null; then
  is_xml=true
  path_option='--path'
else
  is_xml=false
  path_option='--directory'
fi

# we could do "$path_option $PWD "
# to avoid needing rewriting entities that are copied from the header
# into docs under xml
if test "X$searchpath" = "X"; then
    path_arg=
else
    path_arg="$path_option $searchpath"
fi

# Delete the old index.sgml file, if it exists.
if test -f index.sgml; then
      rm -f index.sgml
fi

if $is_xml; then
  @XSLTPROC@ $path_arg --nonet --xinclude \
      --stringparam gtkdoc.bookname $module \
      --stringparam gtkdoc.version "@VERSION@" \
      "$@" $gtkdocdir/gtk-doc.xsl $document || exit $?
else
  @JADE@ $path_arg -t @SGML_FORMAT_TYPE@ -w no-idref -d $gtkdocdir/gtk-doc.dsl \
      -V "gtkdoc-bookname=$module" -V "gtkdoc-version=@VERSION@" \
      "$@" $gtkdocdir/gtk-doc.dcl $document || exit $?
fi

# copy navigation images and stylesheets to html directory ...
cp -f $gtkdocdir/*.png ./
cp -f $gtkdocdir/*.css ./


echo "timestamp" > ../html.stamp