updates.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 12 Aug 2001 13:32:38 +0000 (13:32 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 12 Aug 2001 13:32:38 +0000 (13:32 +0000)
scripts/silcdoc/silcdoc

index dd0fe385cfcc381a05a95553b3a01061f661b762..3ad16e63cc852b76447725de4ef341ff66c044f6 100755 (executable)
@@ -42,26 +42,6 @@ if [ "$TYPE" = "HTML" ]; then
   mkdir /tmp/silcdoc.html
   cp $headers /tmp/silcdoc.html
 
-  # Generate indes template from the DIRECTORY files
-  files=`find $SRC -name "DIRECTORY"`
-  for i in $files
-  do
-    # Get library name
-    name=`grep "@LIBRARY=" $i |cut -d=  -f2`
-    fname=`grep "@FILENAME=" $i |cut -d=  -f2`
-    links=`grep "@LINK=" $i |cut -d=  -f2 |cut -d:  -f1`
-
-    # Generate links to template file that can be included into various
-    # places on the webpage.
-    echo "<A HREF="$fname">$name</A><BR>" >>$DST/index.tmpl
-    for k in $links
-    do
-      n=`grep $k $i |cut -d=  -f2 |cut -d:  -f2`
-      echo "<LI><A HREF="$k">$n</A>" >>$DST/$fname.links
-      echo "&nbsp;&nbsp;&nbsp; <A HREF="$k">$n</A><BR>" >>$DST/index.tmpl
-    done
-  done
-
   # Generate the actual detailed documentation
   path=`pwd`
   cd /tmp/silcdoc.html
@@ -72,15 +52,15 @@ if [ "$TYPE" = "HTML" ]; then
     $ROBO /tmp/silcdoc.html/$i.h $DST/$i.html $TYPE
 
     # Generate the TOC file
-    sh gen.sh $DST gen_toc.php $DST/$i.html $DST/$i.html
-    sh gen.sh $DST index.php $DST/$i.html $DST/$i.html
+    sh gen.sh gen_toc.php $DST/$i.html $DST/$i.html
+    sh gen.sh index.php $DST/$i.html $DST/$i.html
 
     # Generate the details and the layour
     files=`find $DST -name ""$i"_*.html"`
     for k in $files
     do
-      sh gen.sh $DST gen_detail.php $k $k
-      sh gen.sh $DST index.php $k $k
+      sh gen.sh gen_detail.php $k $k
+      sh gen.sh index.php $k $k
     done
 
     rm -f $DST/$i_index.tmpl
@@ -88,30 +68,38 @@ if [ "$TYPE" = "HTML" ]; then
 
   # Generate the index and TOC files from the DIRECTORY files
   files=`find $SRC -name "DIRECTORY"`
+  touch $DST/index.html.tmp
   for i in $files
   do
     # Get library name
     name=`grep "@LIBRARY=" $i |cut -d=  -f2`
     fname=`grep "@FILENAME=" $i |cut -d=  -f2`
+    links=`grep "@LINK=" $i |cut -d=  -f2`
 
     # Generate links for this library
+    for k in $links
+    do
+      l=`echo $k |cut -d:  -f1`
+      n=`echo $k |cut -d:  -f2`
+      echo "<LI><A HREF="$l">$n</A>" >>$DST/$fname.links
+    done
     sed -e "/@LINKS@/ r $DST/$fname.links" -e s/@LINKS@//g $i >$DST/$fname
+    rm -f $DST/$fname.links
 
     # Generate the TOC file for the library
-    sh gen.sh $DST gen_toc.php $DST/$fname $DST/$fname
-    sh gen.sh $DST index.php $DST/$fname $DST/$fname
+    sh gen.sh gen_toc.php $DST/$fname $DST/$fname
+    sh gen.sh index.php $DST/$fname $DST/$fname
 
     # Generate the link for the top index.html for this library
     echo "<LI><A HREF="$fname">$name</A>" >>$DST/index.html.tmp
-    rm -f $DST/$fname.links
   done
 
   # Generate the top index.html file
   index=`find $SRC -name "LIBINDEX"`
   curdate=`date`
   sed -e "/@DATE@/s//$curdate/" -e "/@BODY@/ r $DST/index.html.tmp" -e s/@BODY@//g $index >$DST/index.html
-  sh gen.sh $DST gen_toc.php $DST/index.html $DST/index.html
-  sh gen.sh $DST index.php $DST/index.html $DST/index.html
+  sh gen.sh gen_toc.php $DST/index.html $DST/index.html
+  sh gen.sh index.php $DST/index.html $DST/index.html
 
   rm -rf $DST/index.html.tmp
   rm -rf /tmp/silcdoc.html