Skip to content

Commit e08c9be

Browse files
committed
Making the arrows with the <details> tag look like those used in the treeview
Making the arrows with the `<details>` tag look like those used in the treeview, resulting in adding the settings in doxygen.css There were some problems in the output introduced in the comment scanner - multiple `<summary>` tags were just left there whilst only the first one is relevant for the `<details>` tag, the other `<summary>` tags are just new paragraphs - the `<summary>` tag should only remain in case we are in inside a `<details>` section, otherwise it is handled as a brief description (here the `<summary>` was already ignored, but now it is not even added). - the order of the resulting `<p>` tags in the HTML output was not correct for XHTML (the `<summary>` tag was inside a `<p>` tag, this has been corrected
1 parent 5081d9a commit e08c9be

File tree

2 files changed

+50
-4
lines changed

2 files changed

+50
-4
lines changed

src/commentscan.l

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ struct commentscanYY_state
420420
QCString guardExpr;
421421
int roundCount = 0;
422422
int HTMLDetails = 0;
423+
std::vector<int> HTMLDetailsSummary;
423424

424425
bool insideParBlock = FALSE;
425426
bool inInternalDocs = FALSE;
@@ -638,11 +639,16 @@ STopt [^\n@\\]*
638639
}
639640
<Comment>"<"{DETAILS}{ATTR}">" { // start of a HTML style details description
640641
yyextra->HTMLDetails++;
642+
yyextra->HTMLDetailsSummary.push_back(0);
641643
setOutput(yyscanner,OutputDoc);
642644
addOutput(yyscanner,yytext);
643645
}
644646
<Comment>"</"{DETAILS}">" { // end of a HTML style details description
645-
if (yyextra->HTMLDetails) yyextra->HTMLDetails--;
647+
if (yyextra->HTMLDetails)
648+
{
649+
yyextra->HTMLDetails--;
650+
yyextra->HTMLDetailsSummary.pop_back();
651+
}
646652
addOutput(yyscanner,yytext);
647653
}
648654
<Comment>"<"{AHTML} { // potential start of HTML anchor, see issue 9200
@@ -706,15 +712,35 @@ STopt [^\n@\\]*
706712
}
707713
<Comment>"<"{SUMMARY}">" { // start of a .NET XML style brief description
708714
if (!yyextra->HTMLDetails) setOutput(yyscanner,OutputBrief);
709-
addOutput(yyscanner,yytext);
715+
else
716+
{
717+
int id = yyextra->HTMLDetailsSummary[yyextra->HTMLDetails-1];
718+
if (id == 0)
719+
{
720+
addOutput(yyscanner,"\\htmlonly </p> \\endhtmlonly");
721+
addOutput(yyscanner,yytext);
722+
}
723+
else addOutput(yyscanner,"<p>");
724+
yyextra->HTMLDetailsSummary.pop_back();
725+
yyextra->HTMLDetailsSummary.push_back(id+1);
726+
}
710727
}
711728
<Comment>"<"{REMARKS}">" { // start of a .NET XML style detailed description
712729
setOutput(yyscanner,OutputDoc);
713730
addOutput(yyscanner,yytext);
714731
}
715732
<Comment>"</"{SUMMARY}">" { // start of a .NET XML style detailed description
716-
addOutput(yyscanner,yytext);
717-
if (!yyextra->HTMLDetails) setOutput(yyscanner,OutputDoc);
733+
if (yyextra->HTMLDetails)
734+
{
735+
int id = yyextra->HTMLDetailsSummary[yyextra->HTMLDetails-1];
736+
if (id == 1)
737+
{
738+
addOutput(yyscanner,yytext);
739+
addOutput(yyscanner,"\\htmlonly <p> \\endhtmlonly");
740+
}
741+
else addOutput(yyscanner,"</p>");
742+
}
743+
else setOutput(yyscanner,OutputDoc);
718744
}
719745
<Comment>"</"{REMARKS}">" { // end of a brief or detailed description
720746
setOutput(yyscanner,OutputDoc);

templates/html/doxygen.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,3 +1641,23 @@ u {
16411641
text-decoration: underline;
16421642
}
16431643

1644+
details>summary {
1645+
list-style-type: none;
1646+
}
1647+
1648+
details > summary::-webkit-details-marker {
1649+
display: none;
1650+
}
1651+
1652+
details>summary::before {
1653+
content: "\25ba";
1654+
padding-right:4px;
1655+
font-size: 80%;
1656+
}
1657+
1658+
details[open]>summary::before {
1659+
content: "\25bc";
1660+
padding-right:4px;
1661+
font-size: 80%;
1662+
}
1663+

0 commit comments

Comments
 (0)