aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Formats
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2017-02-23 11:18:44 +0100
committerDmitry Jemerov <yole@jetbrains.com>2017-02-23 12:02:23 +0100
commit1270519a551cd30e452d282247d2d963bc9c25ca (patch)
treea42a39450ac361a25e7e1f901fda1132a428a382 /core/src/main/kotlin/Formats
parent7fa258873eab770577879e9721c0864449ba1114 (diff)
downloaddokka-1270519a551cd30e452d282247d2d963bc9c25ca.tar.gz
dokka-1270519a551cd30e452d282247d2d963bc9c25ca.tar.bz2
dokka-1270519a551cd30e452d282247d2d963bc9c25ca.zip
Refactor SinceKotlin support to a more general "platform" mechanism
Diffstat (limited to 'core/src/main/kotlin/Formats')
-rw-r--r--core/src/main/kotlin/Formats/StructuredFormatService.kt16
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 1488a4f9..02ec01b0 100644
--- a/core/src/main/kotlin/Formats/StructuredFormatService.kt
+++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt
@@ -291,7 +291,7 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
}
item.appendOverrides()
item.appendDeprecation()
- item.appendSinceKotlin()
+ item.appendPlatforms()
}
// All items have exactly the same documentation, so we can use any item to render it
val item = items.first()
@@ -321,12 +321,6 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
}
}
- private fun DocumentationNode.appendSinceKotlin() {
- val annotation = sinceKotlin ?: return
- val value = annotation.detail(NodeKind.Parameter).detail(NodeKind.Value)
- appendSinceKotlin(value.name)
- }
-
private fun DocumentationNode.appendDeprecation() {
if (deprecation != null) {
val deprecationParameter = deprecation!!.details(NodeKind.Parameter).firstOrNull()
@@ -349,6 +343,14 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
}
}
+ private fun DocumentationNode.appendPlatforms() {
+ if (platforms.isEmpty()) return
+ appendParagraph {
+ appendStrong { to.append("Platform and version requirements:") }
+ to.append(" " + platforms.joinToString())
+ }
+ }
+
private fun DocumentationNode.appendDescription() {
if (content.description != ContentEmpty) {
appendContent(content.description)