Build the todo index.

@param Doclet doclet
420324
function todoWriter(&$doclet) {

        parent::MDWriter($doclet);

        $rootDoc = & $this->_doclet->rootDoc();

        $todoClasses = array();
        $classes = & $rootDoc->classes();
        $todoFields = array();
        $todoMethods = array();
        if ($classes) {
            foreach ($classes as $class) {
                if ($class->tags("@todo")) {
                    $todoClasses[] = $class;
                }
                $fields = & $class->fields();
                if ($fields) {
                    foreach ($fields as $field) {
                        if ($field->tags("@todo")) {
                            $todoFields[] = $field;
                        }
                    }
                }
                $classes = & $class->methods();
                if ($classes) {
                    foreach ($classes as $method) {
                        if ($method->tags("@todo")) {
                            $todoMethods[] = $method;
                        }
                    }
                }
            }
        }
        $todoGlobals = array();
        $globals = & $rootDoc->globals();
        if ($globals) {
            foreach ($globals as $global) {
                if ($global->tags("@todo")) {
                    $todoGlobals[] = $global;
                }
            }
        }
        $todoFunctions = array();
        $functions = & $rootDoc->functions();
        if ($functions) {
            foreach ($functions as $function) {
                if ($function->tags("@todo")) {
                    $todoFunctions[] = $function;
                }
            }
        }

        ob_start();

        echo "- - -\n\n";

        echo "#Todo#";

        echo "\n\n- - -\n\n";

        if ($todoClasses || $todoFields || $todoMethods || $todoGlobals || $todoFunctions) {
            echo "##Contents##\n\n";

            echo "<ul>\n";
            if ($todoClasses) {
                echo "<li><a href=\"#todo_class\">Todo Classes</a></li>";
            }
            if ($todoFields) {
                echo "<li><a href=\"#todo_field\">Todo Fields</a></li>";
            }
            if ($todoMethods) {
                echo "<li><a href=\"#todo_method\">Todo Methods</a></li>";
            }
            if ($todoGlobals) {
                echo "<li><a href=\"#todo_global\">Todo Globals</a></li>";
            }
            if ($todoFunctions) {
                echo "<li><a href=\"#todo_function\">Todo Functions</a></li>";
            }
            echo "</ul>\n";
        }

        if ($todoClasses) {
            echo "<table id=\"todo_class\" class=\"detail\">", "\n";
            echo "<tr><th colspan=\"2\" class=\"title\">Todo Classes</th></tr>", "\n";
            foreach ($todoClasses as $class) {
                $todoTag = & $class->tags("@todo");
                echo "<tr><td class=\"name\"><a href=\"", $this->_asURL($class), "\">", $class->qualifiedName(), "</a></td>";
                echo "<td class=\"description\">";
                if ($todoTag)
                    echo strip_tags($this->_processInlineTags($todoTag, TRUE), "<a><b>**<u><em>");
                echo "</td></tr>\n";
            }
            echo "</table>\n\n";
        }

        if ($todoFields) {
            echo "<table id=\"todo_field\" class=\"detail\">", "\n";
            echo "<tr><th colspan=\"2\" class=\"title\">Todo Fields</th></tr>", "\n";
            foreach ($todoFields as $field) {
                $todoTag = & $field->tags("@todo");
                echo "<tr>\n";
                echo "<td class=\"name\"><a href=\"", $this->_asURL($field), "\">", $field->qualifiedName(), "</a></td>\n";
                echo "<td class=\"description\">";
                if ($todoTag)
                    echo strip_tags($this->_processInlineTags($todoTag, TRUE), "<a><b>**<u><em>");
                echo "</td>\n";
                echo "</tr>\n";
            }
            echo "</table>\n\n";
        }

        if ($todoMethods) {
            echo "<table id=\"todo_method\" class=\"detail\">", "\n";
            echo "<tr><th colspan=\"2\" class=\"title\">Todo Methods</th></tr>", "\n";
            foreach ($todoMethods as $method) {
                $todoTag = & $method->tags("@todo");
                echo "<tr>\n";
                echo "<td class=\"name\"><a href=\"", $this->_asURL($method), "\">", $method->qualifiedName(), "</a></td>\n";
                echo "<td class=\"description\">";
                if ($todoTag)
                    echo strip_tags($this->_processInlineTags($todoTag, TRUE), "<a><b>**<u><em>");
                echo "</td>\n";
                echo "</tr>\n";
            }
            echo "</table>\n\n";
        }

        if ($todoGlobals) {
            echo "<table id=\"todo_global\" class=\"detail\">", "\n";
            echo "<tr><th colspan=\"2\" class=\"title\">Todo Globals</th></tr>", "\n";
            foreach ($todoGlobals as $global) {
                $todoTag = & $global->tags("@todo");
                echo "<tr>\n";
                echo "<td class=\"name\"><a href=\"", $this->_asURL($global), "\">", $global->qualifiedName(), "</a></td>\n";
                echo "<td class=\"description\">";
                if ($todoTag)
                    echo strip_tags($this->_processInlineTags($todoTag, TRUE), "<a><b>**<u><em>");
                echo "</td>\n";
                echo "</tr>\n";
            }
            echo "</table>\n\n";
        }

        if ($todoFunctions) {
            echo "<table id=\"todo_function\" class=\"detail\">", "\n";
            echo "<tr><th colspan=\"2\" class=\"title\">Todo Functions</th></tr>", "\n";
            foreach ($todoFunctions as $function) {
                $todoTag = & $function->tags("@todo");
                echo "<tr>\n";
                echo "<td class=\"name\"><a href=\"", $this->_asURL($function), "\">", $function->qualifiedName(), "</a></td>\n";
                echo "<td class=\"description\">";
                if ($todoTag)
                    echo strip_tags($this->_processInlineTags($todoTag, TRUE), "<a><b>**<u><em>");
                echo "</td>\n";
                echo "</tr>\n";
            }
            echo "</table>\n\n";
        }

        $this->_output = ob_get_contents();
        ob_end_clean();

        $this->_write("todo-list.md");
    }
405939
public void buildSignature(XMLNode node, Content propertyDocTree) {
        propertyDocTree.addContent(
                writer.getSignature((MethodDoc) properties.get(currentPropertyIndex)));
    }
503596
public int addDocument(String document) {
    if (root().getNumberOfChildren() >= 0) {
      throw new IllegalStateException("Tree sorting has begun");
    }
    final int index;
    synchronized (this) {
      index = documents.size();
      documents.add(document);
    }
    cursors.addAll(
      IntStream.range(0, document.length() + 1).mapToObj(i -> new CursorData(index, i)).collect(Collectors.toList()));
    nodes.update(0, node -> node.setCursorCount(cursors.length()));
    return index;
  }
445649
public void indexDocument(String indexName, String mappingName, String id, XContentBuilder document)
            throws Exception {
        client.prepareIndex(indexName, mappingName, id).setSource(document).get();
    }
255551
public void buildClassDoc(XMLNode node, Content contentTree) throws Exception {
         String key;
         if (isInterface) {
             key =  "doclet.Interface";
         } else if (isEnum) {
             key = "doclet.Enum";
         } else {
             key =  "doclet.Class";
         }
         contentTree = writer.getHeader(configuration.getText(key) + " " +
                 classDoc.name());
         Content classContentTree = writer.getClassContentHeader();
         buildChildren(node, classContentTree);
         writer.addClassContentTree(contentTree, classContentTree);
         writer.addFooter(contentTree);
         writer.printDocument(contentTree);
         writer.close();
         copyDocFiles();
     }
1316089
@Override
    protected void addIndex(Content body) {
        for (String groupname : groupList) {
            SortedSet<PackageElement> list = groupPackageMap.get(groupname);
            if (list != null && !list.isEmpty()) {
                addIndexContents(list,
                        groupname, configuration.getText("doclet.Member_Table_Summary",
                                groupname, configuration.getText("doclet.packages")), body);
            }
        }
    }
146916
public void buildMethodComments(XMLNode node, Content methodDocTree) {
        if (!configuration.nocomment) {
            MethodDoc method = (MethodDoc) methods.get(currentMethodIndex);

            if (method.inlineTags().length == 0) {
                DocFinder.Output docs = DocFinder.search(configuration,
                        new DocFinder.Input(method));
                method = docs.inlineTags != null && docs.inlineTags.length > 0 ?
                    (MethodDoc) docs.holder : method;
            }
            //NOTE:  When we fix the bug where ClassDoc.interfaceTypes() does
            //       not pass all implemented interfaces, holder will be the
            //       interface type.  For now, it is really the erasure.
            writer.addComments(method.containingClass(), method, methodDocTree);
        }
    }
665859
protected void appendDocumentElementIndication(StringBuilder sb, Document doc) {
        sb.append("<");
        sb.append(doc.getDocumentElement().getNodeName());
        sb.append("...>");
    }
847700
function packageWriter(&$doclet) {

        parent::MDWriter($doclet);

        $rootDoc = & $this->_doclet->rootDoc();
        $phpdoctor = & $this->_doclet->phpdoctor();

        $displayTree = $phpdoctor->getOption("tree");

        if ($displayTree) {
            $this->_id = "tree";

            $tree = array();
            $classes = & $rootDoc->classes();
            if ($classes) {
                foreach ($classes as $class) {
                    $this->_buildTree($tree, $class);
                }
            }

            ob_start();

            echo "\n\n- - -\n\n";
            echo "#Class Hierarchy#\n\n";

            $this->_displayTree($tree);

            $this->_output = ob_get_contents();
            ob_end_clean();

            $this->_write("overview-tree.md");
        }

        $this->_id = "package";

        $packages = & $rootDoc->packages();
        ksort($packages);

        foreach ($packages as $packageName => $package) {

            $this->_depth = $package->depth() + 1;

            ob_start();

            echo "\n\n- - -\n\n";

            echo "#Namespace ", $package->name(), "#\n\n";

            if ($displayTree) {
                echo "<div><a href='{$this->_asURL($package)}/package-tree.md'>View Class Hierarchy for this Package</a></div>\n\n";
            }

            $textTag = & $package->tags("@text");
            if ($textTag) {
                echo "<div class=\"comment\">", $this->_processInlineTags($textTag, TRUE), "</div>\n\n";
                echo "<dl><dt>See:</dt><dd><b><a href=\"#overview_description\">Description</a></b></dd></dl>", "\n\n";
            }

            $classes = & $package->ordinaryClasses();
            if ($classes) {
                ksort($classes);
                echo "<table class=\"title\">", "\n";
                echo "<tr><th colspan=\"2\" class=\"title\">Class Summary</th></tr>", "\n";
                foreach ($classes as $name => $class) {
                    $textTag = & $classes[$name]->tags("@text");
                    echo "<tr><td class=\"name\"><a href=\"", $this->_asURL($classes[$name]), "\">", $classes[$name]->name(), "</a></td>";
                    echo "<td class=\"description\">";
                    if ($textTag)
                        echo strip_tags($this->_processInlineTags($textTag, TRUE), "<a><b>**<u><em>");
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $interfaces = & $package->interfaces();
            if ($interfaces) {
                ksort($interfaces);
                echo "<table class=\"title\">" . "\n";
                echo "<tr><th colspan=\"2\" class=\"title\">Interface Summary</th></tr>" . "\n";
                foreach ($interfaces as $name => $interface) {
                    $textTag = & $interfaces[$name]->tags("@text");
                    echo "<tr><td class=\"name\"><a href=\"", $this->_asURL($interfaces[$name]), "\">", $interfaces[$name]->name(), "</a></td>";
                    echo "<td class=\"description\">";
                    if ($textTag)
                        echo strip_tags($this->_processInlineTags($textTag, TRUE), "<a><b>**<u><em>");
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $exceptions = & $package->exceptions();
            if ($exceptions) {
                ksort($exceptions);
                echo "<table class=\"title\">" . "\n";
                echo "<tr><th colspan=\"2\" class=\"title\">Exception Summary</th></tr>" . "\n";
                foreach ($exceptions as $name => $exception) {
                    $textTag = & $exceptions[$name]->tags("@text");
                    echo "<tr><td class=\"name\"><a href=\"", $this->_asURL($exceptions[$name]), "\">", $exceptions[$name]->name(), "</a></td>";
                    echo "<td class=\"description\">";
                    if ($textTag)
                        echo strip_tags($this->_processInlineTags($textTag, TRUE), "<a><b>**<u><em>");
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $functions = & $package->functions();
            if ($functions) {
                ksort($functions);
                echo "<table class=\"title\">", "\n";
                echo "<tr><th colspan=\"2\" class=\"title\">Function Summary</th></tr>", "\n";
                foreach ($functions as $name => $function) {
                    $textTag = & $functions[$name]->tags("@text");
                    echo "<tr><td class=\"name\"><a href=\"package-functions.md#", $functions[$name]->name(), "\">", $functions[$name]->name(), "</a></td>";
                    echo "<td class=\"description\">";
                    if ($textTag)
                        echo strip_tags($this->_processInlineTags($textTag, TRUE), "<a><b>**<u><em>");
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $globals = & $package->globals();
            if ($globals) {
                ksort($globals);
                echo "<table class=\"title\">", "\n";
                echo "<tr><th colspan=\"2\" class=\"title\">Global Summary</th></tr>", "\n";
                foreach ($globals as $name => $global) {
                    $textTag = & $globals[$name]->tags("@text");
                    echo "<tr><td class=\"name\"><a href=\"package-globals.md#", $globals[$name]->name(), "\">", $globals[$name]->name(), "</a></td>";
                    echo "<td class=\"description\">";
                    if ($textTag)
                        echo strip_tags($this->_processInlineTags($textTag, TRUE), "<a><b>**<u><em>");
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $textTag = & $package->tags("@text");
            if ($textTag) {
                echo "#Namespace ", $package->name(), " Description#\n\n";
                echo "<div class=\"comment\" id=\"overview_description\">" . $this->_processInlineTags($textTag), "</div>\n\n";
            }

            echo "- - -\n\n";

            $this->_output = ob_get_contents();
            ob_end_clean();

            $this->_write($this->_normalize($package->_name) . "_README.md");

            if ($displayTree) {
                $this->_id = "tree";

                $tree = array();
                $classes = & $package->ordinaryClasses();
                if ($classes) {
                    ksort($classes);
                    foreach ($classes as $class) {
                        $this->_buildTree($tree, $class);
                    }
                }

                ob_start();

                echo "- - -\n\n";

                echo "#Class Hierarchy for Package {$package->name()}";
                echo "\n\n<div><a href='{$this->_asURL($package)}'>Back to package summary</a></div>\n\n";

                $this->_displayTree($tree);

                $this->_output = ob_get_contents();
                ob_end_clean();

                $this->_write($this->_normalize($package->_name) . "_package-tree.md", $package->name(), TRUE);
            }
        }
    }
538577
public static DocumentNode toDocumentNode(List<Object> documentNodeParams)
    {
        DocumentNode node = new DocumentNode((String) documentNodeParams.get(NODE_TITLE_INDEX));
        node.setIsExecutable((Boolean) documentNodeParams.get(NODE_EXECUTABLE_INDEX));
        node.setCanBeImplemented((Boolean) documentNodeParams.get(NODE_CAN_BE_IMPLEMENTED_INDEX));
        if (documentNodeParams.size() == 5) {
            node.setURL((String) documentNodeParams.get(NODE_URL_INDEX));
        }

        Hashtable children = (Hashtable) documentNodeParams.get(NODE_CHILDREN_INDEX);
        @SuppressWarnings("unchecked")
        Collection<Vector<Object>> values = children.values();
        for (Vector<Object> nodeParams : values) {

            if(nodeParams.size() > 5 ) {
                node.addChildren(ReferenceNode.toReferenceNode(nodeParams));
            } else {
                node.addChildren(toDocumentNode(nodeParams));
            }
        }

        return node;
    }
27097
@SuppressWarnings("unchecked")
    public void addDoc(Map<String, Object> jsonFields, String collName,
            String docId) {
        if (!mCollections.containsKey(collName)) {
            // add new collection
            log.debug("Added collection " + collName);
            mCollections.put(collName, new ConcurrentHashMap<String, Map<String,Object>>());
        }
        Map<String, Map<String,Object>> collection = mCollections.get(collName);

        Map<String, Object> fields;

        if(jsonFields.get(DdpMessageField.FIELDS) == null) {
            fields = new ConcurrentHashMap<>();
        } else {
            fields = (Map<String, Object>) jsonFields.get(DdpMessageField.FIELDS);
        }

        collection.put(docId, fields);

        if (BuildConfig.DEBUG) {
            log.debug("Added docid " + docId + " to collection " + collName);
        }
    }
1037811
protected void addClassList(Content contentTree) throws IOException {
        String[] classTableHeader = new String[] {
            configuration.getText("doclet.0_and_1",
                    configuration.getText("doclet.Class"),
                    configuration.getText("doclet.Description"))
        };
        Iterator<String> itp = usingPackageToUsedClasses.keySet().iterator();
        while (itp.hasNext()) {
            String packageName = itp.next();
            PackageDoc usingPackage = configuration.root.packageNamed(packageName);
            HtmlTree li = new HtmlTree(HtmlTag.LI);
            li.addStyle(HtmlStyle.blockList);
            if (usingPackage != null) {
                li.addContent(getMarkerAnchor(usingPackage.name()));
            }
            String tableSummary = configuration.getText("doclet.Use_Table_Summary",
                    configuration.getText("doclet.classes"));
            Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, tableSummary,
                    getTableCaption(configuration.getResource(
                    "doclet.ClassUse_Classes.in.0.used.by.1",
                    getPackageLink(pkgdoc, Util.getPackageName(pkgdoc)),
                    getPackageLink(usingPackage, Util.getPackageName(usingPackage)))));
            table.addContent(getSummaryTableHeader(classTableHeader, "col"));
            Content tbody = new HtmlTree(HtmlTag.TBODY);
            Iterator<ClassDoc> itc =
                    usingPackageToUsedClasses.get(packageName).iterator();
            for (int i = 0; itc.hasNext(); i++) {
                HtmlTree tr = new HtmlTree(HtmlTag.TR);
                if (i % 2 == 0) {
                    tr.addStyle(HtmlStyle.altColor);
                } else {
                    tr.addStyle(HtmlStyle.rowColor);
                }
                addClassRow(itc.next(), packageName, tr);
                tbody.addContent(tr);
            }
            table.addContent(tbody);
            li.addContent(table);
            contentTree.addContent(li);
        }
    }
1212371
private void indexDocument(HelpModule helpModule, Resource resource) throws Exception {
        String title = getTitle(resource);
        
        try (InputStream is = resource.getInputStream()) {
            Document document = new Document();
            document.add(new TextField("module", helpModule.getLocalizedId(), Store.YES));
            document.add(new TextField("source", helpModule.getTitle(), Store.YES));
            document.add(new TextField("title", title, Store.YES));
            document.add(new TextField("url", resource.getURL().toString(), Store.YES));
            document.add(new TextField("content", tika.parseToString(is), Store.NO));
            writer.addDocument(document);
        }
    }
886914
public static void generate(ConfigurationImpl configuration,
                                IndexBuilder indexbuilder) {
        SingleIndexWriter indexgen;
        DocPath filename = DocPaths.INDEX_ALL;
        try {
            indexgen = new SingleIndexWriter(configuration,
                                             filename, indexbuilder);
            indexgen.generateIndexFile();
            indexgen.close();
        } catch (IOException exc) {
            configuration.standardmessage.error(
                        "doclet.exception_encountered",
                        exc.toString(), filename);
            throw new DocletAbortException(exc);
        }
    }
687543
@Override
    public void build() throws DocletException {
        if (writer == null) {
            //Doclet does not support this output.
            return;
        }
        build(layoutParser.parseXML(ROOT), contentTree);
    }
443405
protected void addModulePackagesIndex(Content body, ModuleElement mdle) {
        addModulePackagesIndexContents("doclet.Module_Summary",
                configuration.getText("doclet.Member_Table_Summary",
                configuration.getText("doclet.Module_Summary"),
                configuration.getText("doclet.modules")), body, mdle);
    }
1118775
public function packageWriter(&$doclet)
    {

        parent::HTMLWriter($doclet);

        $rootDoc =& $this->_doclet->rootDoc();
        $phpdoctor =& $this->_doclet->phpdoctor();

        $displayTree = $phpdoctor->getOption('tree');

        if ($displayTree) {
            $this->_sections[0] = array('title' => 'Overview', 'url' => 'overview-summary.html');
            $this->_sections[1] = array('title' => 'Namespace');
            $this->_sections[2] = array('title' => 'Class');
            //$this->_sections[3] = array('title' => 'Use');
            $this->_sections[4] = array('title' => 'Tree', 'selected' => TRUE);
            if ($doclet->includeSource()) $this->_sections[5] = array('title' => 'Files', 'url' => 'overview-files.html');
            $this->_sections[6] = array('title' => 'Deprecated', 'url' => 'deprecated-list.html');
            $this->_sections[7] = array('title' => 'Todo', 'url' => 'todo-list.html');
            $this->_sections[8] = array('title' => 'Index', 'url' => 'index-all.html');

            $this->_id = 'tree';

            $tree = array();
            $classes =& $rootDoc->classes();
            if ($classes) {
                foreach ($classes as $class) {
                    $this->_buildTree($tree, $class);
                }
            }

            ob_start();

            echo "<hr>\n\n";
            echo '<h1>Class Hierarchy</h1>';

            $this->_displayTree($tree);

            $this->_output = ob_get_contents();
            ob_end_clean();

            $this->_write('overview-tree.html', 'Overview', TRUE);
        }

        $this->_id = 'package';

        $packages =& $rootDoc->packages();
        ksort($packages);

        foreach ($packages as $packageName => $package) {

            $this->_depth = $package->depth() + 1;

            $this->_sections[0] = array('title' => 'Overview', 'url' => 'overview-summary.html');
            $this->_sections[1] = array('title' => 'Namespace', 'selected' => TRUE);
            $this->_sections[2] = array('title' => 'Class');
            //$this->_sections[3] = array('title' => 'Use');
            if ($displayTree) $this->_sections[4] = array('title' => 'Tree', 'url' => $package->asPath().'/package-tree.html');
            if ($doclet->includeSource()) $this->_sections[5] = array('title' => 'Files', 'url' => 'overview-files.html');
            $this->_sections[6] = array('title' => 'Deprecated', 'url' => 'deprecated-list.html');
            $this->_sections[7] = array('title' => 'Todo', 'url' => 'todo-list.html');
            $this->_sections[8] = array('title' => 'Index', 'url' => 'index-all.html');

            ob_start();

            echo "<hr>\n\n";

            echo '<h1>Namespace ', $package->name(), "</h1>\n\n";

            $textTag =& $package->tags('@text');
            if ($textTag) {
                echo '<div class="comment">', $this->_processInlineTags($textTag, TRUE), "</div>\n\n";
                echo '<dl><dt>See:</dt><dd><b><a href="#overview_description">Description</a></b></dd></dl>', "\n\n";
            }

            $classes =& $package->ordinaryClasses();
            if ($classes) {
                ksort($classes);
                echo '<table class="title">', "\n";
                echo '<tr><th colspan="2" class="title">Class Summary</th></tr>', "\n";
                foreach ($classes as $name => $class) {
                    $textTag =& $classes[$name]->tags('@text');
                    echo '<tr><td class="name"><a href="', str_repeat('../', $this->_depth), $classes[$name]->asPath(), '">', $classes[$name]->name(), '</a></td>';
                    echo '<td class="description">';
                    if ($textTag) echo strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>');
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $interfaces =& $package->interfaces();
            if ($interfaces) {
                ksort($interfaces);
                echo '<table class="title">'."\n";
                echo '<tr><th colspan="2" class="title">Interface Summary</th></tr>'."\n";
                foreach ($interfaces as $name => $interface) {
                    $textTag =& $interfaces[$name]->tags('@text');
                    echo '<tr><td class="name"><a href="', str_repeat('../', $this->_depth), $interfaces[$name]->asPath(), '">', $interfaces[$name]->name(), '</a></td>';
                    echo '<td class="description">';
                    if ($textTag) echo strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>');
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $traits =& $package->traits();
            if ($traits) {
                ksort($traits);
                echo '<table class="title">'."\n";
                echo '<tr><th colspan="2" class="title">Trait Summary</th></tr>'."\n";
                foreach ($traits as $name => $trait) {
                    $textTag =& $traits[$name]->tags('@text');
                    echo '<tr><td class="name"><a href="', str_repeat('../', $this->_depth), $traits[$name]->asPath(), '">', $traits[$name]->name(), '</a></td>';
                    echo '<td class="description">';
                    if ($textTag) echo strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>');
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $exceptions =& $package->exceptions();
            if ($exceptions) {
                ksort($exceptions);
                echo '<table class="title">'."\n";
                echo '<tr><th colspan="2" class="title">Exception Summary</th></tr>'."\n";
                foreach ($exceptions as $name => $exception) {
                    $textTag =& $exceptions[$name]->tags('@text');
                    echo '<tr><td class="name"><a href="', str_repeat('../', $this->_depth), $exceptions[$name]->asPath(), '">', $exceptions[$name]->name(), '</a></td>';
                    echo '<td class="description">';
                    if ($textTag) echo strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>');
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $functions =& $package->functions();
            if ($functions) {
                ksort($functions);
                echo '<table class="title">', "\n";
                echo '<tr><th colspan="2" class="title">Function Summary</th></tr>', "\n";
                foreach ($functions as $name => $function) {
                    $textTag =& $functions[$name]->tags('@text');
                    echo '<tr><td class="name"><a href="package-functions.html#', $functions[$name]->name(), '">', $functions[$name]->name(), '</a></td>';
                    echo '<td class="description">';
                    if ($textTag) echo strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>');
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $globals =& $package->globals();
            if ($globals) {
                ksort($globals);
                echo '<table class="title">', "\n";
                echo '<tr><th colspan="2" class="title">Global Summary</th></tr>', "\n";
                foreach ($globals as $name => $global) {
                    $textTag =& $globals[$name]->tags('@text');
                    echo '<tr><td class="name"><a href="package-globals.html#', $globals[$name]->name(), '">', $globals[$name]->name(), '</a></td>';
                    echo '<td class="description">';
                    if ($textTag) echo strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>');
                    echo "</td></tr>\n";
                }
                echo "</table>\n\n";
            }

            $textTag =& $package->tags('@text');
            if ($textTag) {
                echo '<h1>Namespace ', $package->name(), " Description</h1>\n\n";
                echo '<div class="comment" id="overview_description">'. $this->_processInlineTags($textTag), "</div>\n\n";
            }

            echo "<hr>\n\n";

            $this->_output = ob_get_contents();
            ob_end_clean();

            $this->_write($package->asPath().'/package-summary.html', $package->name(), TRUE);

            if ($displayTree) {

                $this->_sections[0] = array('title' => 'Overview', 'url' => 'overview-summary.html');
                $this->_sections[1] = array('title' => 'Namespace', 'url' => $package->asPath().'/package-summary.html', 'relative' => TRUE);
                $this->_sections[2] = array('title' => 'Class');
                //$this->_sections[3] = array('title' => 'Use');
                $this->_sections[4] = array('title' => 'Tree', 'url' => $package->asPath().'/package-tree.html', 'selected' => TRUE, 'relative' => TRUE);
                if ($doclet->includeSource()) $this->_sections[5] = array('title' => 'Files', 'url' => 'overview-files.html');
                $this->_sections[6] = array('title' => 'Deprecated', 'url' => 'deprecated-list.html');
                $this->_sections[7] = array('title' => 'Todo', 'url' => 'todo-list.html');
                $this->_sections[8] = array('title' => 'Index', 'url' => 'index-all.html');

                $this->_id = 'tree';

                $tree = array();
                $classes =& $package->ordinaryClasses();
                if ($classes) {
                    ksort($classes);
                    foreach ($classes as $class) {
                        $this->_buildTree($tree, $class);
                    }
                }

                ob_start();

                echo "<hr>\n\n";

                echo '<h1>Class Hierarchy for Package ', $package->name(),'</h1>';

                $this->_displayTree($tree);

                $this->_output = ob_get_contents();
                ob_end_clean();

                $this->_write($package->asPath().'/package-tree.html', $package->name(), TRUE);
            }

        }

    }