From 091294c5a920521df1b4bf61c2492b78f3559321 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Wed, 20 May 2020 17:58:31 +0200 Subject: Tabs for sections - update tests --- .../translators/documentables/DefaultPageCreator.kt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'plugins/base/src/main/kotlin/translators/documentables') diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 409b0d6f..847e9667 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -202,7 +202,7 @@ open class DefaultPageCreator( protected open fun contentForDescription( d: Documentable - ): ContentNode { + ): List { val tags: GroupedTags = d.documentation.flatMap { (pd, doc) -> doc.children.asSequence().map { pd to it }.toList() }.groupBy { it.second::class } @@ -224,17 +224,19 @@ open class DefaultPageCreator( val unnamedTags: List> = tags.filterNot { (k, _) -> k.isSubclassOf(NamedTagWrapper::class) || k in specialTags } .map { (_, v) -> v.mapNotNull { (k,v) -> k?.let { it to v } }.toMap() } - platforms.forEach { platform -> - unnamedTags.forEach { pdTag -> - pdTag[platform]?.also { tag -> - group(sourceSets = setOf(platform)) { - header(4, tag.toHeaderString()) - comment(tag.root) + if(unnamedTags.isNotEmpty()){ + platforms.forEach { platform -> + unnamedTags.forEach { pdTag -> + pdTag[platform]?.also { tag -> + group(sourceSets = setOf(platform)) { + header(4, tag.toHeaderString()) + comment(tag.root) + } } } } } - } + }.children } protected open fun contentForComments( -- cgit