diff options
Diffstat (limited to 'opensuse/core/tdelibs.old/create-kdeapi')
-rw-r--r-- | opensuse/core/tdelibs.old/create-kdeapi | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/opensuse/core/tdelibs.old/create-kdeapi b/opensuse/core/tdelibs.old/create-kdeapi new file mode 100644 index 000000000..6a11907eb --- /dev/null +++ b/opensuse/core/tdelibs.old/create-kdeapi @@ -0,0 +1,107 @@ +#! /bin/sh +# Copyright (c) 2001 SuSE GmbH Nuernberg, Germany. All rights reserved. +# +# Author: Adrian Schroeter <[email protected]> +# +# This module generates a index.html page for all KDE main api index.html pages +# SuSEhelp will use this index.html page as start point + +r=`pwd` +while test ! -x usr/share/doc/TDE-API/ && test "$r" != "/"; do + r=`dirname $root` + cd .. +done + +kdeapi=/usr/share/doc/TDE-API/ + +if test ! -w $r/${kdeapi} ; then + echo "The KDE API directory $kdeapi is not writeable. Exit..." + exit 1 +fi + +# +# write html header +# +cat > $r/${kdeapi}/index.html <<EOF +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="Author" content="[email protected]"> + <meta name="GENERATOR" content="create-kdeapi"> + <title>KDE API Reference</title> +</head> + +<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000"> + <CENTER><H1>KDE 3.x API Reference</H1></CENTER> + +EOF + +# +# list all the api start pages +# + +cat >> $r/${kdeapi}/index.html <<EOF +<TABLE WIDTH="100%" BORDER="0"> +<TR bgcolor="b0b0b0"> +<TH> </TH><TH>Description</TH><TH>from package</TH></TR> +<TR bgcolor="ffffff"><TD><A HREF="/usr/share/doc/packages/qt3/html/classes.html"> +Qt </A></TD> <TD>all Qt classes</TD> <TD>qt</TD></TR> +EOF + +dark=1 +mods= +list=`ls -1 $r/${kdeapi}/*/index.html 2> /dev/null` +for page in $list; do + mainapi=`echo $page | sed -n -e "s@$r/$kdeapi/\([^/]*\)/index.html@\1@p"` + mods="$mods $mainapi" + eval "page_$mainapi=$page" + eval "path_$mainapi=/$kdeapi/$mainapi" +done + +list=`ls -1 $r/opt/tde/share/doc/HTML/en/*-apidocs/*/html/index.html 2> /dev/null` +for page in $list; do + mainapi=`echo $page | sed -n -e "s@$r/opt/tde/share/doc/HTML/en/.*-apidocs/\([^/]*\)/html/index.html@\1@p"` + mods="$mods $mainapi" + path=`echo $page | sed -e "s,$r/opt,/opt,"` + eval "page_$mainapi=$path" + path=`echo $page | sed -n -e "s@$r\(/opt/tde/share/doc/HTML/en/.*-apidocs/[^/]*\)/html/index.html@\1@p"` + eval "path_$mainapi=$path" +done + +mods=`(for i in $mods; do echo $i; done ) | sort` + +for mod in $mods; do + eval "apipath=$""page_$mod" + eval "basepath=$""path_$mod" + description="`cat $r/$basepath/description.SuSE`" + package="`cat $r/$basepath/package.SuSE`" + + if [ "$dark" == "1" ]; then + dark=0 + echo "<TR bgcolor=\"eeeeee\">" >> $r/${kdeapi}/index.html + else + dark=1 + echo "<TR bgcolor=\"ffffff\">" >> $r/${kdeapi}/index.html + fi + + echo "<TD><A HREF=\"${apipath}\"> ${mod} </A></TD>" >> $r/${kdeapi}/index.html + echo "<TD>${description}</TD>" >> $r/${kdeapi}/index.html + echo "<TD>${package}</TD>" >> $r/${kdeapi}/index.html + echo "</TR>" >> $r/${kdeapi}/index.html + +done + +# +# finish it ... +# +cat >> $r/${kdeapi}/index.html <<EOF +</TABLE> +<hr> +<table> +<tr><td><small> generated by create-kdeapi on `date` </td></tr> +</table> + +</body> +</html> +EOF |