diff options
| author | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-23 11:18:44 +0100 |
|---|---|---|
| committer | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-23 12:02:23 +0100 |
| commit | 1270519a551cd30e452d282247d2d963bc9c25ca (patch) | |
| tree | a42a39450ac361a25e7e1f901fda1132a428a382 /core/src/main/kotlin/Formats | |
| parent | 7fa258873eab770577879e9721c0864449ba1114 (diff) | |
| download | dokka-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.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 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) |
