Skip to content

Commit d7d52d7

Browse files
committed
Generators/HTML: only display a TOC when there is more than one doc
1 parent f9c5f18 commit d7d52d7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Generators/HTML.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ protected function printHeader()
152152
*/
153153
protected function printToc()
154154
{
155+
// Only show a TOC when there are two or more docs to display.
156+
if (count($this->docFiles) < 2) {
157+
return;
158+
}
159+
155160
echo ' <h2>Table of Contents</h2>'.PHP_EOL;
156161
echo ' <ul class="toc">'.PHP_EOL;
157162

tests/Core/Generators/Expectations/ExpectedOutputOneDoc.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@
7070
</head>
7171
<body>
7272
<h1>GeneratorTest Coding Standards</h1>
73-
<h2>Table of Contents</h2>
74-
<ul class="toc">
75-
<li><a href="#One-Standard-Block,-No-Code">One Standard Block, No Code</a></li>
76-
</ul>
7773
<a name="One-Standard-Block,-No-Code" />
7874
<h2>One Standard Block, No Code</h2>
7975
<p class="text">Documentation contains one standard block and no code comparison.</p>

0 commit comments

Comments
 (0)