From daed35f92b3b482688856d139da6849c8e6b4ab1 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Tue, 14 Feb 2023 21:30:00 +0100 Subject: [PATCH] Do not render filter-section for empty source sets (#2858) Regression from #2848 --- .../html/innerTemplating/DefaultTemplateModelFactory.kt | 5 ++++- .../dokka/templates/includes/source_set_selector.ftl | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/base/src/main/kotlin/renderers/html/innerTemplating/DefaultTemplateModelFactory.kt b/plugins/base/src/main/kotlin/renderers/html/innerTemplating/DefaultTemplateModelFactory.kt index 3437271acf..4fee280e60 100644 --- a/plugins/base/src/main/kotlin/renderers/html/innerTemplating/DefaultTemplateModelFactory.kt +++ b/plugins/base/src/main/kotlin/renderers/html/innerTemplating/DefaultTemplateModelFactory.kt @@ -72,7 +72,10 @@ class DefaultTemplateModelFactory(val context: DokkaContext) : TemplateModelFact .sortedBy { it.comparableKey } .map { SourceSetModel(it.name, it.platform.key, it.sourceSetIDs.merged.toString()) } .toList() - mapper["sourceSets"] = sourceSets + + if (sourceSets.isNotEmpty()) { + mapper["sourceSets"] = sourceSets + } } return mapper } diff --git a/plugins/base/src/main/resources/dokka/templates/includes/source_set_selector.ftl b/plugins/base/src/main/resources/dokka/templates/includes/source_set_selector.ftl index 13650ee59c..2d848071f3 100644 --- a/plugins/base/src/main/resources/dokka/templates/includes/source_set_selector.ftl +++ b/plugins/base/src/main/resources/dokka/templates/includes/source_set_selector.ftl @@ -1,9 +1,9 @@ <#macro display> - <#if sourceSets??> + <#if sourceSets?has_content>
<#list sourceSets as ss>
- \ No newline at end of file +