Skip to content

Commit 98aca21

Browse files
committed
Add page outline navigation panel to HTML output
1 parent 1ca6d10 commit 98aca21

37 files changed

+604
-240
lines changed

src/classdef.cpp

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
324324
void writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup,int indentLevel,
325325
const ClassDef *inheritedFrom,const QCString &inheritId) const override;
326326
void writeQuickMemberLinks(OutputList &ol,const MemberDef *md) const override;
327+
void writePageNavigation(OutputList &ol) const override;
327328
void writeSummaryLinks(OutputList &ol) const override;
328329
void reclassifyMember(MemberDefMutable *md,MemberType t) override;
329330
void writeInlineDocumentation(OutputList &ol) const override;
@@ -764,6 +765,8 @@ class ClassDefAliasImpl : public DefinitionAliasMixin<ClassDef>
764765
{ getCdAlias()->writeQuickMemberLinks(ol,md); }
765766
void writeSummaryLinks(OutputList &ol) const override
766767
{ getCdAlias()->writeSummaryLinks(ol); }
768+
void writePageNavigation(OutputList &ol) const override
769+
{ getCdAlias()->writePageNavigation(ol); }
767770
void writeInlineDocumentation(OutputList &ol) const override
768771
{ getCdAlias()->writeInlineDocumentation(ol); }
769772
void writeTagFile(TextStream &ol) const override
@@ -1672,7 +1675,7 @@ void ClassDefImpl::writeDetailedDescription(OutputList &ol, const QCString &/*pa
16721675
ol.popGeneratorState();
16731676
}
16741677

1675-
ol.startGroupHeader();
1678+
ol.startGroupHeader("details");
16761679
ol.parseText(title);
16771680
ol.endGroupHeader();
16781681

@@ -2307,6 +2310,11 @@ void ClassDefImpl::writeSummaryLinks(OutputList &ol) const
23072310
ol.popGeneratorState();
23082311
}
23092312

2313+
void ClassDefImpl::writePageNavigation(OutputList &ol) const
2314+
{
2315+
ol.writePageOutline();
2316+
}
2317+
23102318
void ClassDefImpl::writeTagFile(TextStream &tagFile) const
23112319
{
23122320
if (!isLinkableInProject() || isArtificial()) return;
@@ -2451,7 +2459,7 @@ void ClassDefImpl::writeInlineDocumentation(OutputList &ol) const
24512459
ol.disable(OutputType::Html);
24522460
{
24532461
// for LaTeX/RTF/Man
2454-
ol.startGroupHeader(1);
2462+
ol.startGroupHeader("",1);
24552463
ol.parseText(s);
24562464
ol.endGroupHeader(1);
24572465
}
@@ -2641,9 +2649,11 @@ void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const QCStrin
26412649
found=TRUE;
26422650
}
26432651
ol.startMemberDeclaration();
2644-
ol.startMemberItem(anchor(),OutputGenerator::MemberItemType::Normal);
26452652
QCString ctype = compoundTypeString();
26462653
QCString cname = displayName(!localNames);
2654+
QCString anc = anchor();
2655+
if (anc.isEmpty()) anc = cname; else anc.prepend(cname+"_");
2656+
ol.startMemberItem(anc,OutputGenerator::MemberItemType::Normal);
26472657

26482658
if (lang!=SrcLangExt::VHDL) // for VHDL we swap the name and the type
26492659
{
@@ -2972,7 +2982,17 @@ void ClassDefImpl::writeDocumentation(OutputList &ol) const
29722982
}
29732983

29742984
AUTO_TRACE("name='{}' getOutputFileBase='{}'",name(),getOutputFileBase());
2975-
startFile(ol,getOutputFileBase(),name(),pageTitle,hli,!generateTreeView);
2985+
bool hasAllMembersLink=false;
2986+
for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
2987+
{
2988+
if (lde->kind()==LayoutDocEntry::ClassAllMembersLink)
2989+
{
2990+
hasAllMembersLink = true;
2991+
break;
2992+
}
2993+
}
2994+
bool hasAllMembersPage = hasAllMembersLink && !m_allMemberNameInfoLinkedMap.empty() && !Config_getBool(OPTIMIZE_OUTPUT_FOR_C);
2995+
startFile(ol,getOutputFileBase(),name(),pageTitle,hli,!generateTreeView,QCString(),0,hasAllMembersPage);
29762996
if (!generateTreeView)
29772997
{
29782998
if (getOuterScope()!=Doxygen::globalScope)
@@ -4895,7 +4915,7 @@ void ClassDefImpl::writeMemberDocumentation(OutputList &ol,MemberListType lt,con
48954915
{
48964916
//printf("%s: ClassDefImpl::writeMemberDocumentation()\n",qPrint(name()));
48974917
MemberList * ml = getMemberList(lt);
4898-
if (ml) ml->writeDocumentation(ol,displayName(),this,title,FALSE,showInline);
4918+
if (ml) ml->writeDocumentation(ol,displayName(),this,title,ml->listType().toLabel(),FALSE,showInline);
48994919
}
49004920

49014921
void ClassDefImpl::writeSimpleMemberDocumentation(OutputList &ol,MemberListType lt) const

src/classdef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ class ClassDef : public Definition
357357
int indentLevel, const ClassDef *inheritedFrom,const QCString &inheritId) const = 0;
358358
virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *md) const = 0;
359359
virtual void writeSummaryLinks(OutputList &ol) const = 0;
360+
virtual void writePageNavigation(OutputList &ol) const = 0;
360361
virtual void writeInlineDocumentation(OutputList &ol) const = 0;
361362
virtual void writeTagFile(TextStream &) const = 0;
362363
virtual void writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedClasses,

src/conceptdef.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ QCString ConceptDefImpl::initializer() const
428428

429429
void ConceptDefImpl::writeDefinition(OutputList &ol,const QCString &title) const
430430
{
431-
ol.startGroupHeader();
431+
ol.startGroupHeader("conceptdef");
432432
ol.parseText(title);
433433
ol.endGroupHeader();
434434

@@ -460,7 +460,7 @@ void ConceptDefImpl::writeDetailedDescription(OutputList &ol,const QCString &tit
460460
ol.writeAnchor(QCString(),"details");
461461
ol.popGeneratorState();
462462

463-
ol.startGroupHeader();
463+
ol.startGroupHeader("details");
464464
ol.parseText(title);
465465
ol.endGroupHeader();
466466

@@ -657,9 +657,11 @@ void ConceptDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const QCStr
657657
found=TRUE;
658658
}
659659
ol.startMemberDeclaration();
660-
ol.startMemberItem(anchor(),OutputGenerator::MemberItemType::Normal);
661-
ol.writeString("concept ");
662660
QCString cname = displayName(!localNames);
661+
QCString anc=anchor();
662+
if (anc.isEmpty()) anc=cname; else anc.prepend(cname+"_");
663+
ol.startMemberItem(anc,OutputGenerator::MemberItemType::Normal);
664+
ol.writeString("concept ");
663665
ol.insertMemberAlign();
664666
if (isLinkable())
665667
{

src/definition.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,6 +1823,10 @@ void DefinitionImpl::writeSummaryLinks(OutputList &) const
18231823
{
18241824
}
18251825

1826+
void DefinitionImpl::writePageNavigation(OutputList &) const
1827+
{
1828+
}
1829+
18261830
//---------------------------------------------------------------------------------
18271831

18281832
DefinitionAliasImpl::DefinitionAliasImpl(Definition *def,const Definition *scope, const Definition *alias)

src/definition.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ class DefinitionMutable
381381
virtual void writeNavigationPath(OutputList &ol) const = 0;
382382
virtual void writeQuickMemberLinks(OutputList &,const MemberDef *) const = 0;
383383
virtual void writeSummaryLinks(OutputList &) const = 0;
384+
virtual void writePageNavigation(OutputList &) const = 0;
384385
virtual void writeDocAnchorsToTagFile(TextStream &) const = 0;
385386
virtual void writeToc(OutputList &ol, const LocalToc &lt) const = 0;
386387

src/definitionimpl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ class DefinitionImpl
119119
QCString navigationPathAsString() const;
120120
void writeQuickMemberLinks(OutputList &,const MemberDef *) const;
121121
void writeSummaryLinks(OutputList &) const;
122+
void writePageNavigation(OutputList &ol) const;
122123
QCString pathFragment() const;
123124
void writeDocAnchorsToTagFile(TextStream &) const;
124125
void setLocalName(const QCString &name);
@@ -275,6 +276,8 @@ class DefinitionMixin : public Base
275276
{ m_impl.writeQuickMemberLinks(ol,md); }
276277
void writeSummaryLinks(OutputList &ol) const override
277278
{ m_impl.writeSummaryLinks(ol); }
279+
void writePageNavigation(OutputList &ol) const override
280+
{ m_impl.writePageNavigation(ol); }
278281
QCString pathFragment() const override
279282
{ return m_impl.pathFragment(); }
280283
void writeDocAnchorsToTagFile(TextStream &fs) const override

src/dirdef.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class DirDefImpl : public DefinitionMixin<DirDef>
6363
QCString shortTitle() const override;
6464
bool hasDetailedDescription() const override;
6565
void writeDocumentation(OutputList &ol) override;
66+
void writePageNavigation(OutputList &ol) const override;
6667
void writeTagFile(TextStream &t) override;
6768
void setDiskName(const QCString &name) override { m_diskName = name; }
6869
void sort() override;
@@ -240,7 +241,7 @@ void DirDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
240241
ol.disableAllBut(OutputType::Html);
241242
ol.writeAnchor(QCString(),"details");
242243
ol.popGeneratorState();
243-
ol.startGroupHeader();
244+
ol.startGroupHeader("details");
244245
ol.parseText(title);
245246
ol.endGroupHeader();
246247

@@ -312,6 +313,11 @@ void DirDefImpl::writeBriefDescription(OutputList &ol)
312313
ol.writeSynopsis();
313314
}
314315

316+
void DirDefImpl::writePageNavigation(OutputList &ol) const
317+
{
318+
ol.writePageOutline();
319+
}
320+
315321
void DirDefImpl::writeDirectoryGraph(OutputList &ol)
316322
{
317323
// write graph dependency graph
@@ -357,7 +363,9 @@ void DirDefImpl::writeSubDirList(OutputList &ol)
357363
if (dd->hasDocumentation() || !dd->getFiles().empty())
358364
{
359365
ol.startMemberDeclaration();
360-
ol.startMemberItem(dd->anchor(),OutputGenerator::MemberItemType::Normal);
366+
QCString anc=dd->anchor();
367+
if (anc.isEmpty()) anc=dd->shortName(); else anc.prepend(dd->shortName()+"_");
368+
ol.startMemberItem(anc,OutputGenerator::MemberItemType::Normal);
361369
{
362370
ol.pushGeneratorState();
363371
ol.disableAllBut(OutputType::Html);
@@ -423,7 +431,9 @@ void DirDefImpl::writeFileList(OutputList &ol)
423431
if (doc || src)
424432
{
425433
ol.startMemberDeclaration();
426-
ol.startMemberItem(fd->anchor(),OutputGenerator::MemberItemType::Normal);
434+
QCString anc = fd->anchor();
435+
if (anc.isEmpty()) anc=fd->displayName(); else anc.prepend(fd->displayName()+"_");
436+
ol.startMemberItem(anc,OutputGenerator::MemberItemType::Normal);
427437
{
428438
ol.pushGeneratorState();
429439
ol.disableAllBut(OutputType::Html);

src/docbookgen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ void DocbookGenerator::endBold()
830830
DB_GEN_C
831831
m_t << "</emphasis>";
832832
}
833-
void DocbookGenerator::startGroupHeader(int extraIndentLevel)
833+
void DocbookGenerator::startGroupHeader(const QCString &,int extraIndentLevel)
834834
{
835835
DB_GEN_C2("m_inLevel " << m_inLevel)
836836
DB_GEN_C2("extraIndentLevel " << extraIndentLevel)
@@ -969,7 +969,7 @@ void DocbookGenerator::endMemberDocName()
969969
{
970970
DB_GEN_C
971971
}
972-
void DocbookGenerator::startMemberGroupHeader(bool)
972+
void DocbookGenerator::startMemberGroupHeader(const QCString &,bool)
973973
{
974974
DB_GEN_C
975975
m_t << "<simplesect><title>";

0 commit comments

Comments
 (0)