diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2020-10-08 20:37:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-08 20:37:55 +0200 |
commit | e54d9b20f5a4935d0089a77dbea16c27c065cf48 (patch) | |
tree | 1dc85acdb92f6bc3b3feff68d280c187d1c8eb48 /plugins/base/src/main | |
parent | b278dcc8fa854d7f708196f91c7e0efbbe9667ef (diff) | |
download | dokka-e54d9b20f5a4935d0089a77dbea16c27c065cf48.tar.gz dokka-e54d9b20f5a4935d0089a77dbea16c27c065cf48.tar.bz2 dokka-e54d9b20f5a4935d0089a77dbea16c27c065cf48.zip |
Handle multiple authors (#1539)
Diffstat (limited to 'plugins/base/src/main')
-rw-r--r-- | plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 5cd8b0ff..6c3c0330 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -320,16 +320,18 @@ open class DefaultPageCreator( } } - val unnamedTags: List<SourceSetDependent<TagWrapper>> = - tags.filterNot { (k, _) -> k.isSubclassOf(NamedTagWrapper::class) || k in specialTags } - .map { (_, v) -> v.mapNotNull { (k, v) -> k?.let { it to v } }.toMap() } + val unnamedTags = tags.filterNot { (k, _) -> k.isSubclassOf(NamedTagWrapper::class) || k in specialTags } + .values.flatten().groupBy { it.first }.mapValues { it.value.map { it.second } } if (unnamedTags.isNotEmpty()) { platforms.forEach { platform -> - unnamedTags.forEach { pdTag -> - pdTag[platform]?.also { tag -> - group(sourceSets = setOf(platform), styles = emptySet()) { - header(4, tag.toHeaderString()) - comment(tag.root) + unnamedTags[platform]?.let { tags -> + if(tags.isNotEmpty()){ + tags.groupBy { it::class }.forEach { + (_, sameCategoryTags) -> + group(sourceSets = setOf(platform), styles = emptySet()) { + header(4, sameCategoryTags.first().toHeaderString()) + sameCategoryTags.forEach { comment(it.root) } + } } } } |