updates
[crypto.git] / scripts / silcdoc / silcdoc
index 23c342f24e5839acd0c06cb169563a71734dee39..75136813db79e31bbf0532838c2765282c9bd272 100755 (executable)
@@ -68,9 +68,7 @@ if [ "$TYPE" = "HTML" ]; then
 
   # Generate the index and TOC files from the DIRECTORY files
   files=`find $SRC -name "DIRECTORY"`
-  index=`find $SRC -name "LIBINDEX"`
-  curdate=`date`
-  sed -e "/@DATE@/s//$curdate/" $index >$DST/index.html
+  touch $DST/index.html.tmp
   for i in $files
   do
     # Get library name
@@ -82,12 +80,16 @@ if [ "$TYPE" = "HTML" ]; then
     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
+    echo "<LI><A HREF="$fname">$name</A>" >>$DST/index.html.tmp
   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 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
 fi