iliaa           Mon Jun 20 22:51:42 2005 EDT

  Modified files:              
    /livedocs   mkindex.php 
  Log:
  Shortened names of VARLISTENTRY.
  Stop indexing QANDAENTRY, these do not have short titles and are always 
  page sub-components.
  
  
http://cvs.php.net/diff.php/livedocs/mkindex.php?r1=1.44&r2=1.45&ty=u
Index: livedocs/mkindex.php
diff -u livedocs/mkindex.php:1.44 livedocs/mkindex.php:1.45
--- livedocs/mkindex.php:1.44   Mon Jun 20 21:52:59 2005
+++ livedocs/mkindex.php        Mon Jun 20 22:51:39 2005
@@ -19,7 +19,7 @@
 // | construct an index                                                   |
 // +----------------------------------------------------------------------+
 //
-// $Id: mkindex.php,v 1.44 2005/06/21 01:52:59 iliaa Exp $
+// $Id: mkindex.php,v 1.45 2005/06/21 02:51:39 iliaa Exp $
 
 
 /* just to be on the safe side */
@@ -54,7 +54,7 @@
        return '';
 }
 
-$titles = array('TITLE'=>1, 'REFNAME'=>2, 'QANDAENTRY'=>2, 'VARLISTENTRY'=>2, 
'TITLEABBREV' => 2);
+$titles = array('TITLE'=>1, 'REFNAME'=>2, 'VARLISTENTRY'=>2, 'TITLEABBREV' => 
2);
 
 class DocBookXMLFileParser {
        var $fileid = false;
@@ -63,6 +63,7 @@
        var $data = '';
        var $title_depth = -1;
        var $incomp = 0;
+       var $lt = '';
 
        function DocBookXMLFileParser($filename, $rel, $parser) {
                $this->fileid = $GLOBALS['fileid'];
@@ -97,6 +98,7 @@
                if ($this->last_id !== false) {
                        if (isset($GLOBALS['titles'][$name])) {
                                $this->title_depth = 1;
+                               $this->lt = $name;
                        } else {
                                ++$this->title_depth;
                        }
@@ -104,6 +106,12 @@
        }
 
        function end_elem($parser, $name) {
+               // varlistentry may have many sub-tags, for brevity sake we 
only take parameter
+               if ($this->lt == 'VARLISTENTRY' && $name == 'PARAMETER') {
+                       $this->title_depth = 1;
+                       $name = $this->lt;
+               }
+       
                if ($this->last_id !== false && $this->title_depth && 
--$this->title_depth == 0) {
                        echo "\tAdded ID {$this->last_id}\n";
 
@@ -112,7 +120,7 @@
                                        $this->data .= "'');";
                                        $this->incomp = 0;
                                }
-                               $this->cdata = null;
+                               $this->lt = $this->cdata = null;
                                $this->last_id = false;
                                return;
                        }
@@ -131,7 +139,7 @@
                        if ($GLOBALS['titles'][$name] != 1) {
                                $this->last_id = false;
                        }
-                       $this->cdata = null;
+                       $this->lt = $this->cdata = null;
                }
        }
 

Reply via email to