@@ -1536,6 +1536,34 @@ static void writeSingleFileIndex(OutputList &ol,const FileDef *fd)
15361536 // --------------------------------------------------------
15371537 }
15381538}
1539+ // ----------------------------------------------------------------------------
1540+
1541+ static void writeDirIndex (OutputList &ol)
1542+ {
1543+ if (Index::instance ().numDocumentedDirs ()==0 ) return ;
1544+ ol.pushGeneratorState ();
1545+ ol.disable (OutputType::Html);
1546+
1547+ QCString title = theTranslator->trDirectories ();
1548+ startFile (ol," dirs" ,QCString (),title,HighlightedItem::Files);
1549+ startTitle (ol,title);
1550+ ol.parseText (title);
1551+ endTitle (ol,QCString (),QCString ());
1552+
1553+ ol.startIndexList ();
1554+ for (const auto &dir : *Doxygen::dirLinkedMap)
1555+ {
1556+ if (dir->hasDocumentation ())
1557+ {
1558+ writeDirTreeNode (ol, dir.get (), 1 , nullptr , false );
1559+ }
1560+ }
1561+
1562+ ol.endIndexList ();
1563+
1564+ endFile (ol);
1565+ ol.popGeneratorState ();
1566+ }
15391567
15401568// ----------------------------------------------------------------------------
15411569
@@ -5049,6 +5077,12 @@ static void writeIndex(OutputList &ol)
50495077 ol.parseText (/* projPrefix+*/ theTranslator->trTopicIndex ());
50505078 ol.endIndexSection (IndexSection::isTopicIndex);
50515079 }
5080+ if (index.numDocumentedDirs ()>0 )
5081+ {
5082+ ol.startIndexSection (IndexSection::isDirIndex);
5083+ ol.parseText (theTranslator->trDirIndex ());
5084+ ol.endIndexSection (IndexSection::isDirIndex);
5085+ }
50525086 if (Config_getBool (SHOW_NAMESPACES) && (index.numDocumentedNamespaces ()>0 ))
50535087 {
50545088 LayoutNavEntry *lne = LayoutDocManager::instance ().rootNavEntry ()->find (LayoutNavEntry::Namespaces);
@@ -5140,6 +5174,12 @@ static void writeIndex(OutputList &ol)
51405174 ol.parseText (/* projPrefix+*/ theTranslator->trTopicDocumentation ());
51415175 ol.endIndexSection (IndexSection::isTopicDocumentation);
51425176 }
5177+ if (index.numDocumentedDirs ()>0 )
5178+ {
5179+ ol.startIndexSection (IndexSection::isDirDocumentation);
5180+ ol.parseText (/* projPrefix+*/ theTranslator->trDirDocumentation ());
5181+ ol.endIndexSection (IndexSection::isDirDocumentation);
5182+ }
51435183 if (index.numDocumentedNamespaces ()>0 )
51445184 {
51455185 ol.startIndexSection (IndexSection::isNamespaceDocumentation);
@@ -5514,6 +5554,9 @@ static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &
55145554 }
55155555 // printf("ending %s kind=%d\n",qPrint(lne->title()),lne->kind());
55165556 }
5557+
5558+ // always write the directory index as it is used for non-HTML output only
5559+ writeDirIndex (ol);
55175560}
55185561
55195562static bool quickLinkVisible (LayoutNavEntry::Kind kind)
0 commit comments