diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-02-27 18:30:30 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-02-27 18:30:30 +0300 |
commit | ef753c8a1b9f02d9f6f026d555d628fbb207c574 (patch) | |
tree | 6c70dec31eb1a010f6b9db44dcac7a7720ab8d56 /core/src/main/kotlin/Formats | |
parent | 289d287993b4618f73ebcbc5056a5495238a5836 (diff) | |
download | dokka-ef753c8a1b9f02d9f6f026d555d628fbb207c574.tar.gz dokka-ef753c8a1b9f02d9f6f026d555d628fbb207c574.tar.bz2 dokka-ef753c8a1b9f02d9f6f026d555d628fbb207c574.zip |
Package platforms detected based on it's members, refactored multiplatform tests layout
Diffstat (limited to 'core/src/main/kotlin/Formats')
-rw-r--r-- | core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt | 2 | ||||
-rw-r--r-- | core/src/main/kotlin/Formats/StructuredFormatService.kt | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt b/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt index 6366ff61..0444a25a 100644 --- a/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt +++ b/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt @@ -148,7 +148,7 @@ open class KotlinWebsiteOutputBuilder(to: StringBuilder, override fun appendIndexRow(platforms: Set<String>, block: () -> Unit) { if (platforms.isNotEmpty()) - wrap("<tr data-platform=\"${platforms.joinToString(" ")}\">", "</tr>", block) + wrap("<tr data-platform=\"${platforms.joinToString()}\">", "</tr>", block) else appendTableRow(block) } diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index b5a35356..79ebabe0 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -408,7 +408,7 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, return } - appendSection("Packages", node.members(NodeKind.Package)) + appendSection("Packages", node.members(NodeKind.Package), platformsBasedOnMembers = true) appendSection("Types", node.members.filter { it.kind in NodeKind.classLike && it.kind != NodeKind.TypeAlias && it.kind != NodeKind.AnnotationClass && it.kind != NodeKind.Exception }) appendSection("Annotations", node.members(NodeKind.AnnotationClass)) appendSection("Exceptions", node.members(NodeKind.Exception)) @@ -463,7 +463,8 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, private fun appendSection(caption: String, members: List<DocumentationNode>, sortMembers: Boolean = true, - omitSamePlatforms: Boolean = false) { + omitSamePlatforms: Boolean = false, + platformsBasedOnMembers: Boolean = false) { if (members.isEmpty()) return appendHeader(3) { appendText(caption) } @@ -476,7 +477,11 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, appendTable("Name", "Summary") { appendTableBody { for ((memberLocation, members) in membersMap) { - val platforms = platformsOfItems(members, omitSamePlatforms) + val elementPlatforms = platformsOfItems(members, omitSamePlatforms) + val platforms = if (platformsBasedOnMembers) + members.flatMapTo(mutableSetOf()) { platformsOfItems(it.members) } + elementPlatforms + else + elementPlatforms appendIndexRow(platforms) { appendTableCell { appendLink(memberLocation) |