5 sed -e 's/id="current"/class="current"/' \
6 | tidy -ascii -q --wrap 0 --show-warnings no --fix-uri no \
7 | sed -e 's/name="\([^"]*\)"\([^>]*\) id="\1"/name="\1"\2/g' \
8 -e 's/id="\([^"]*\)"\([^>]*\) name="\1"/name="\1"\2/g' \
9 | xsltproc --novalid --nonet --html --stringparam topdir "$reltopdir" \
10 "$base/html-munge.xsl" -
13 ###########################################################################
15 # Build absolute, normalized pathname
24 -e 's/\/\.\(\/\|$\)/\1/g' \
27 -e 's/\/[^\/]*\/..\(\/\|$\)/\1/' \
29 -e 's/^\(\/..\)*\(\/\|$\)/\2/' \
33 # Create relative path from absolute directory $1 to absolute path $2
36 local src="`abspath "$1"`" # `"
37 local dst="`abspath "$2"`" # `"
41 if [ -z "$src" -a -z "$dst" ]; then
42 echo "Internal error in relpath()" 1>&2
47 if [ "$srcd" = "$dstd" ]; then
48 src="${src#$srcd}"; src="${src#/}"
49 dst="${dst#$dstd}"; dst="${dst#/}"
54 rel="`echo "$src" | sed -e "s/[^\/]*/../g"`/$dst" # `"
58 # Log executed commands
68 do_html_cleanup <"${1}.orig" >"$1"
71 ###########################################################################
73 name="`basename "$0"`"; #`"
74 base="`dirname "$0"`"; base="`cd "$base"; pwd`" #`"
77 TEMP=`getopt -n $name -o '' -l html,tagfile,tagfile-name:,tagfiles:,output-dir:,html-dir: -- "$@"`
78 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
81 tagxsl="$base/tag-munge.xsl"
83 html="NO"; tagfile="NO"; tagfile_name=""; tagfiles=""; output_dir="doc"; html_dir="html"
90 tagfile="YES" ; shift ;;
92 tagfile_name="$2"; shift 2 ;;
95 f="`abspath "$f"`" #`"
96 tagfiles="$tagfiles${tagfiles:+ }$f"
101 output_dir="$2"; shift 2 ;;
103 html_dir="$2"; shift 2 ;;
107 echo "Internal error: $*"; exit 1 ;;
117 [--tagfile-name=<name>]
126 if [ "$tagfile" = "YES" -a -z "$tagfile_name" ]; then
127 echo "--tagfile-name is required with --tagfile"
133 if [ -f "$doxydir" ]; then
134 doxydir="`dirname "$doxydir"`" #`"
137 doxydir="`abspath "$doxydir"`" #`"
139 ###########################################################################
143 if [ -z "$TOPDIR" ]; then
145 while [ ! -r "SConstruct" -a "`pwd`" != "/" ]; do cd ..; done
146 if [ ! -r "SConstruct" ]; then
147 echo "topdir not found"
153 reltopdir="`relpath "$doxydir/$output_dir/$html_dir" "$TOPDIR"`" #`"
157 ## Remove tagfile_name from list of tagfiles
159 if [ -n "$tagfile_name" ]; then
160 tagfile_name="`abspath "$output_dir/$tagfile_name"`" #`"
161 x="$tagfiles"; tagfiles=""
163 if [ "$f" != "$tagfile_name" ]; then
164 tagfiles="$tagfiles${tagfiles:+ }$f"
169 ## Remove empty tagfiles from list of tagfiles
171 x="$tagfiles"; tagfiles=""
174 tagfiles="$tagfiles${tagfiles:+ }$f"
178 ## Call doxygen proper
181 if [ "$tagfile" = "YES" ]; then
182 generate_tagfile="$tagfile_name"
184 export TOPDIR LIBDIR html tagfile tagfile_name tagfiles output_dir html_dir generate_tagfile
187 cmd ${DOXYGEN:-doxygen}
190 ## Clean up tagfile, if generated
192 if [ "$tagfile" = "YES" ]; then
193 mv "$tagfile_name" "${tagfile_name}.orig"
194 cmd xsltproc --novalid --nonet -o "$tagfile_name" "$tagxsl" "${tagfile_name}.orig"
200 if [ -n "$tagfiles" ]; then
202 for f in $tagfiles; do
203 n="`basename "$f"`" #`"
204 d="`dirname "$f"`" #`"
205 url="`relpath "$doxydir/$output_dir/$html_dir" "$d/$html_dir"`" #`"
206 args="$args${args:+ }-l $n@$url"
210 cd "./$output_dir/$html_dir"
211 cmd "./installdox" $args
216 ## Postprocess html files, if generated
218 if [ "$html" = "YES" ]; then
219 for h in "$doxydir/$output_dir/$html_dir"/*.html; do
220 cmd html_cleanup "$h"