From 2a045d31d0d3099bf024022613a48aacbd77aef9 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 5 Nov 2024 01:47:08 +0100 Subject: [PATCH] Generators/HTML: only display a TOC when there is more than one doc --- src/Generators/HTML.php | 5 +++++ tests/Core/Generators/Expectations/ExpectedOutputOneDoc.html | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Generators/HTML.php b/src/Generators/HTML.php index f2f2e64bdd..0f3733b984 100644 --- a/src/Generators/HTML.php +++ b/src/Generators/HTML.php @@ -156,6 +156,11 @@ protected function printHeader() */ protected function printToc() { + // Only show a TOC when there are two or more docs to display. + if (count($this->docFiles) < 2) { + return; + } + echo '

Table of Contents

'.PHP_EOL; echo '