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 | xsltproc --novalid --nonet --html --stringparam topdir "$reltopdir" \
9 "$base/html-munge.xsl" -
12 ###########################################################################
14 # Build absolute, normalized pathname
23 -e 's/\/\.\(\/\|$\)/\1/g' \
26 -e 's/\/[^\/]*\/..\(\/\|$\)/\1/' \
28 -e 's/^\(\/..\)*\(\/\|$\)/\2/' \
32 # Create relative path from absolute directory $1 to absolute path $2
35 local src="`abspath "$1"`" # `"
36 local dst="`abspath "$2"`" # `"
40 if [ -z "$src" -a -z "$dst" ]; then
41 echo "Internal error in relpath()" 1>&2
46 if [ "$srcd" = "$dstd" ]; then
47 src="${src#$srcd}"; src="${src#/}"
48 dst="${dst#$dstd}"; dst="${dst#/}"
53 rel="`echo "$src" | sed -e "s/[^\/]*/../g"`/$dst" # `"
57 # Log executed commands
67 do_html_cleanup <"${1}.orig" >"$1"
70 ###########################################################################
72 name="`basename "$0"`"; #`"
73 base="`dirname "$0"`"; base="`cd "$base"; pwd`" #`"
76 TEMP=`getopt -n $name -o '' -l html,tagfile,tagfile-name:,tagfiles:,output-dir:,html-dir: -- "$@"`
77 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
80 tagxsl="$base/tag-munge.xsl"
82 html="NO"; tagfile="NO"; tagfile_name=""; tagfiles=""; output_dir="doc"; html_dir="html"
89 tagfile="YES" ; shift ;;
91 tagfile_name="$2"; shift 2 ;;
94 f="`abspath "$f"`" #`"
95 tagfiles="$tagfiles${tagfiles:+ }$f"
100 output_dir="$2"; shift 2 ;;
102 html_dir="$2"; shift 2 ;;
106 echo "Internal error: $*"; exit 1 ;;
116 [--tagfile-name=<name>]
125 if [ "$tagfile" = "YES" -a -z "$tagfile_name" ]; then
126 echo "--tagfile-name is required with --tagfile"
132 if [ -f "$doxydir" ]; then
133 doxydir="`dirname "$doxydir"`" #`"
136 doxydir="`abspath "$doxydir"`" #`"
138 ###########################################################################
142 if [ -z "$TOPDIR" ]; then
144 while [ ! -r "SConstruct" -a "`pwd`" != "/" ]; do cd ..; done
145 if [ ! -r "SConstruct" ]; then
146 echo "topdir not found"
152 reltopdir="`relpath "$doxydir/$output_dir/$html_dir" "$TOPDIR"`" #`"
156 ## Remove tagfile_name from list of tagfiles
158 if [ -n "$tagfile_name" ]; then
159 tagfile_name="`abspath "$output_dir/$tagfile_name"`" #`"
160 x="$tagfiles"; tagfiles=""
162 if [ "$f" != "$tagfile_name" ]; then
163 tagfiles="$tagfiles${tagfiles:+ }$f"
168 ## Remove empty tagfiles from list of tagfiles
170 x="$tagfiles"; tagfiles=""
173 tagfiles="$tagfiles${tagfiles:+ }$f"
177 ## Call doxygen proper
180 if [ "$tagfile" = "YES" ]; then
181 generate_tagfile="$tagfile_name"
183 export TOPDIR LIBDIR html tagfile tagfile_name tagfiles output_dir html_dir generate_tagfile
186 cmd ${DOXYGEN:-doxygen}
189 ## Clean up tagfile, if generated
191 if [ "$tagfile" = "YES" ]; then
192 mv "$tagfile_name" "${tagfile_name}.orig"
193 cmd xsltproc --novalid --nonet -o "$tagfile_name" "$tagxsl" "${tagfile_name}.orig"
199 if [ -n "$tagfiles" ]; then
201 for f in $tagfiles; do
202 n="`basename "$f"`" #`"
203 d="`dirname "$f"`" #`"
204 url="`relpath "$doxydir/$output_dir/$html_dir" "$d/$html_dir"`" #`"
205 args="$args${args:+ }-l $n@$url"
209 cd "./$output_dir/$html_dir"
210 cmd "./installdox" $args
215 ## Postprocess html files, if generated
217 if [ "$html" = "YES" ]; then
218 for h in "$doxydir/$output_dir/$html_dir"/*.html; do
219 cmd html_cleanup "$h"