Index: branches/eam_branches/ipp-20120905/dvodist/www-util/ipp.php
===================================================================
--- branches/eam_branches/ipp-20120905/dvodist/www-util/ipp.php	(revision 34550)
+++ branches/eam_branches/ipp-20120905/dvodist/www-util/ipp.php	(revision 34551)
@@ -34,4 +34,5 @@
 }
 
+// generate the menu based on the text file
 function menulines ($source, $root, $append, $project) {
 
@@ -43,4 +44,5 @@
     if (count($line) < 2) continue;
 
+    // allow load of other menu files
     if (count($line) == 2) {
       $value = trim($line[0]);
@@ -51,4 +53,6 @@
       continue;
     }
+
+    // blithly skip lines with invalid entries
     if (count($line) != 5) continue;
 
@@ -158,4 +162,36 @@
 }
 
+function parse_dirlist ($input) {
+  echo "<table class=\"dirlist\">\n";
+
+  $inlist = explode ("\n", $input);
+  $Ninlist = count($inlist);
+  for ($i = 0; $i < $Ninlist; $i++) {
+    $inline = trim ($inlist[$i], "@ \t");
+    $line = explode (":", $inline);
+    if (ereg ('^[:blank:]*#', $line[0])) continue;
+    if (count($line) < 2) continue;
+    if (count($line) != 4) continue;
+
+    $name  = trim($line[0]);
+    $type  = trim($line[1]);
+    $style = trim($line[2]);
+    $info  = trim($line[3]);
+
+    switch ($type) { 
+    case 'plain':
+      echo "<tr class=\"$style\"><td>$name</td><td>$info</td></tr>\n";  
+      break;
+    case 'dir':
+      echo "<tr class=\"$style\"><td><a class=\"$style\" href=\"$name\">$name</a></td><td>$info</td></tr>\n";
+      break;
+    default:
+      echo "<tr class=\"$style\"><td><a class=\"$style\" href=\"$name\">$name</a></td><td>$info</td></tr>\n";
+      break;
+    } 
+  }
+  echo "</table>\n";
+}
+
 function verbatim ($source) {
   $file = fopen ($source, "r");
@@ -180,15 +216,46 @@
 }
 
+// lines which start with @ are processed by 'dirlist', all others are processed by Markdown
 function do_markdown ($source) {
   $file = fopen ($source, "r");
 
   // loop over the lines in the file and generate lines in the menu
-  $ascii = "";
+  $to_markdwn = "";
+  $to_dirlist = "";
   while ($line = fgets ($file, 1024)) {
-    $ascii .= $line;
-  }
-  fclose ($file);
-  $my_html = Markdown($ascii);
-  echo "$my_html";
+    // echo "line: $line";
+    if (!strncmp($line, "@", 1)) {
+      if ($to_markdwn) {
+	// echo "<b> start markdown</b><br>\n";
+	$my_html = Markdown($to_markdwn);
+	echo "$my_html";
+	$to_markdwn = "";
+      }
+      $to_dirlist .= $line;
+    } else {
+      if ($to_dirlist) {
+	// echo "<b> start dirlist</b><br>\n";
+	parse_dirlist($to_dirlist);
+	$to_dirlist = "";
+      }
+      $to_markdwn .= $line;
+    }
+  }
+  // echo "end of lines<br>\n";
+  // echo "to_markdwn: $to_markdwn\n";
+  // echo "<br>\n";
+  // echo "to_dirlist: $to_dirlist\n";
+  // echo "<br>\n";
+
+  if ($to_markdwn) {
+    $my_html = Markdown($to_markdwn);
+    echo "$my_html";
+    $to_markdwn = "";
+  }
+  if ($to_dirlist) {
+    parse_dirlist($to_dirlist);
+    $to_dirlist = "";
+  }
+  fclose ($file);
 }
 
