diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2018-10-02 03:23:01 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2018-10-02 03:23:01 +0300 |
commit | 0f19897ef9de71f571b1af703ac33923640cb547 (patch) | |
tree | 612e919c32f36f63edfd790b56fb7cc4b95868bb /core | |
parent | 0741416fc19add9f83f3754eb99550b3c3578cf9 (diff) | |
download | dokka-0f19897ef9de71f571b1af703ac33923640cb547.tar.gz dokka-0f19897ef9de71f571b1af703ac33923640cb547.tar.bz2 dokka-0f19897ef9de71f571b1af703ac33923640cb547.zip |
Fix single node & group node pages platform display
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/kotlin/Formats/StructuredFormatService.kt | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index eda85031..67e8c503 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -392,7 +392,6 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, if (!item.content.isEmpty()) { val platforms = effectivePlatformsForNode(item) appendAsPlatformDependentBlock(platforms) { - appendPlatforms(platforms) appendContent(item.summary) item.content.appendDescription() } @@ -409,13 +408,13 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, if (item.kind !in NodeKind.classLike || !isSingleNode) appendAnchor(it.name) } + appendPlatforms(platforms) appendAsSignature(rendered) { appendCode { appendContent(rendered) } item.appendSourceLink() } item.appendOverrides() item.appendDeprecation() - appendPlatforms(platforms) } } @@ -433,10 +432,11 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, appendAnchor(it.name) } + appendPlatforms(platforms) + appendAsSignature(sign) { appendCode { appendContent(sign) } } - appendPlatforms(platforms) first.appendOverrides() first.appendDeprecation() } @@ -611,11 +611,13 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, renderGroupNode(node, true) - for ((content, origins) in node.origins.groupBy { it.content }) { + val groupByContent = node.origins.groupBy { it.content } + for ((content, origins) in groupByContent) { if (content.isEmpty()) continue - val platforms = effectivePlatformAndVersion(origins) - appendAsPlatformDependentBlock(platforms) { - appendPlatforms(platforms) + appendAsPlatformDependentBlock(effectivePlatformsForMembers(origins)) { platforms -> + if (groupByContent.keys.count { !it.isEmpty() } > 1) { + appendPlatforms(platforms) + } appendContent(content) } } |