aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2017-02-23 12:01:55 +0100
committerDmitry Jemerov <yole@jetbrains.com>2017-02-23 12:02:29 +0100
commit287c8207f6c7534ac9c5dfbc6e2ce10fae9a696b (patch)
tree258734e8f55323f93837afb93bd19a574dd323e1
parent1270519a551cd30e452d282247d2d963bc9c25ca (diff)
downloaddokka-287c8207f6c7534ac9c5dfbc6e2ce10fae9a696b.tar.gz
dokka-287c8207f6c7534ac9c5dfbc6e2ce10fae9a696b.tar.bz2
dokka-287c8207f6c7534ac9c5dfbc6e2ce10fae9a696b.zip
Show platforms of a node in summary table
-rw-r--r--core/src/main/kotlin/Formats/StructuredFormatService.kt15
-rw-r--r--core/testdata/format/sinceKotlin.package.md2
2 files changed, 14 insertions, 3 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)
diff --git a/core/testdata/format/sinceKotlin.package.md b/core/testdata/format/sinceKotlin.package.md
index 5e9250f8..2af0c9ee 100644
--- a/core/testdata/format/sinceKotlin.package.md
+++ b/core/testdata/format/sinceKotlin.package.md
@@ -4,5 +4,5 @@
### Types
-| [Since1.1](test/-since1.1/index) | `class Since1.1`<br>Useful |
+| [Since1.1](test/-since1.1/index)<br>(Kotlin 1.1) | `class Since1.1`<br>Useful |