File: mkhtml

package info (click to toggle)
libpcapnav 0.8-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,968 kB
  • ctags: 207
  • sloc: sh: 8,869; ansic: 1,849; makefile: 221
file content (59 lines) | stat: -rwxr-xr-x 1,125 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
#
# Hacked version of gtkdoc-mkhtml to allow using different stylesheets.

usage="\
Usage: mkhtml MODULE SGML_FILE STYLESHEET"

if test "x$1" = "x--version"; then
      echo "0.10"
      exit 0
fi

if test $# -lt 2; then
      echo "${usage}" 1>&2
      exit 1
fi

module=$1
document=$2
prefix=/usr
gtkdocdir=/usr/share/gtk-doc/data

declaration=$gtkdocdir/gtk-doc.dcl

if head -1 $document | grep -q "<?xml"; then
  is_xml=true
else
  is_xml=false
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

    stylesheet=$gtkdocdir/gtk-doc.xsl
    if test $# -ge 3; then
	stylesheet=$3
    fi
    
    /usr/bin/xsltproc --xinclude --stringparam gtkdoc.bookname $module $stylesheet $document
    cp -f $gtkdocdir/*.png .
else

    stylesheet=$gtkdocdir/gtk-doc.dsl
    if test $# -ge 3; then
	stylesheet=$3
    fi

    /usr/bin/openjade -t sgml -w no-idref -d $stylesheet \
	$gtkdocdir/gtk-doc.dcl $document
    
    sed s%href=\"%href=\"$module/% < index.sgml > index.sgml.tmp && mv index.sgml.tmp index.sgml
fi

echo "timestamp" > ../html.stamp