Skip to content

Commit 2bf0cd1

Browse files
committed
issue doxygen#11593 Missing links for LaTex, RTF, ... with IMPLICIT_DIR_DOCS
1 parent 3fd4df3 commit 2bf0cd1

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed

src/dirdef.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class DirDefImpl : public DefinitionMixin<DirDef>
7373
void addUsesDependency(const DirDef *usedDir,const FileDef *srcFd,
7474
const FileDef *dstFd,bool srcDirect, bool dstDirect) override;
7575
void computeDependencies() override;
76+
void findSectionsInDocumentation() override;
7677

7778
bool hasDirectoryGraph() const override;
7879
void overrideDirectoryGraph(bool e) override;
@@ -761,6 +762,12 @@ void DirDefImpl::addUsesDependency(const DirDef *dir,const FileDef *srcFd,
761762
}
762763
}
763764

765+
void DirDefImpl::findSectionsInDocumentation()
766+
{
767+
docFindSections(briefDescription(),this,docFile());
768+
docFindSections(documentation(),this,docFile());
769+
}
770+
764771
/** Computes the dependencies between directories
765772
*/
766773
void DirDefImpl::computeDependencies()

src/dirdef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ class DirDef : public DefinitionMutable, public Definition
139139
virtual void addUsesDependency(const DirDef *usedDir,const FileDef *srcFd,
140140
const FileDef *dstFd,bool srcDirect, bool dstDirect) = 0;
141141
virtual void computeDependencies() = 0;
142+
virtual void findSectionsInDocumentation() = 0;
142143

143144
// directory graph related members
144145
virtual bool hasDirectoryGraph() const = 0;

src/doxygen.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9320,6 +9320,11 @@ static void findSectionsInDocumentation()
93209320
{
93219321
pd->findSectionsInDocumentation();
93229322
}
9323+
// for each directory
9324+
for (const auto &dd : *Doxygen::dirLinkedMap)
9325+
{
9326+
dd->findSectionsInDocumentation();
9327+
}
93239328
ModuleManager::instance().findSectionsInDocumentation();
93249329
if (Doxygen::mainPage) Doxygen::mainPage->findSectionsInDocumentation();
93259330
}

src/index.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

55195562
static bool quickLinkVisible(LayoutNavEntry::Kind kind)

0 commit comments

Comments
 (0)