diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-23 12:01:55 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-23 12:02:29 +0100 |
commit | 287c8207f6c7534ac9c5dfbc6e2ce10fae9a696b (patch) | |
tree | 258734e8f55323f93837afb93bd19a574dd323e1 /core/src | |
parent | 1270519a551cd30e452d282247d2d963bc9c25ca (diff) | |
download | dokka-287c8207f6c7534ac9c5dfbc6e2ce10fae9a696b.tar.gz dokka-287c8207f6c7534ac9c5dfbc6e2ce10fae9a696b.tar.bz2 dokka-287c8207f6c7534ac9c5dfbc6e2ce10fae9a696b.zip |
Show platforms of a node in summary table
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/Formats/StructuredFormatService.kt | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index 02ec01b0..71f9d577 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -457,11 +457,12 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, val membersMap = children.groupBy { link(node, it) } appendTable("Name", "Summary") { - appendTableBody() { + appendTableBody { for ((memberLocation, members) in membersMap) { - appendTableRow() { + appendTableRow { appendTableCell { appendLink(memberLocation) + appendPlatforms(members) } appendTableCell { val breakdownBySummary = members.groupBy { it.summary } @@ -495,6 +496,16 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, renderedSignatures.last().appendSignature() } } + + private fun appendPlatforms(items: List<DocumentationNode>) { + val platforms = items.foldRight(items.first().platforms.toSet()) { + node, platforms -> platforms.intersect(node.platforms) + } + if (platforms.isNotEmpty()) { + appendLine() + to.append("(${platforms.joinToString()})") + } + } } inner class AllTypesNodeBuilder(val node: DocumentationNode) |