From 72b45b70f207e8d289db1ee6554722472b7430e7 Mon Sep 17 00:00:00 2001 From: KrystianUjma Date: Tue, 25 Jun 2019 13:12:24 +0200 Subject: fix *.dataTags tests --- .../Formats/KotlinWebsiteHtmlFormatService.kt | 6 ++++++ .../main/kotlin/Formats/StructuredFormatService.kt | 8 +++++++- .../dataTags/multiplatform.package.html | 24 ++++++++++++++-------- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt b/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt index 86bc9df9..3cdea156 100644 --- a/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt +++ b/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt @@ -35,6 +35,12 @@ open class KotlinWebsiteHtmlOutputBuilder( } } + override fun appendSinceKotlin(version: String) { + } + + override fun appendSinceKotlinWrapped(version: String) { + } + override fun appendCode(body: () -> Unit) = wrapIfNotEmpty("", "", body) protected fun div(to: StringBuilder, cssClass: String, otherAttributes: String = "", block: () -> Unit) { diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index 62ea1108..7299670e 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -114,6 +114,12 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, appendCode { appendText(version) } } + open fun appendSinceKotlinWrapped(version: String) { + wrap(" (", ")") { + appendSinceKotlin(version) + } + } + open fun appendSectionWithTag(section: ContentSection) { appendParagraph { appendStrong { appendText(section.tag) } @@ -776,7 +782,7 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, } if (membersList.singleOrNull()?.sinceKotlin != null){ - wrap(" (", ")"){ appendSinceKotlin(membersList.single().sinceKotlin.toString()) } + appendSinceKotlinWrapped(membersList.single().sinceKotlin.toString()) } // } // if (members.singleOrNull()?.kind != NodeKind.ExternalClass) { diff --git a/core/testdata/format/website-html/dataTags/multiplatform.package.html b/core/testdata/format/website-html/dataTags/multiplatform.package.html index 4806f9d1..99f0b7a2 100644 --- a/core/testdata/format/website-html/dataTags/multiplatform.package.html +++ b/core/testdata/format/website-html/dataTags/multiplatform.package.html @@ -6,7 +6,8 @@
JRE7
1.0
-jre7
fun jre7(): Unit
+

jre7

+
fun jre7(): Unit
@@ -14,35 +15,40 @@
JRE7
1.1
-jre7New (Since: 1.1)
fun jre7New(): Unit
+

jre7New

+
fun jre7New(): Unit
JS
1.0
-js
fun js(): Unit
+

js

+
fun js(): Unit
JS
1.1
-jsNew (Since: 1.1)
fun jsNew(): Unit
+

jsNew

+
fun jsNew(): Unit
JVM
1.0
-jvm
fun jvm(): Unit
+

jvm

+
fun jvm(): Unit
JVM
1.1
-jvmNew (Since: 1.1)
fun jvmNew(): Unit
+

jvmNew

+
fun jvmNew(): Unit
@@ -51,7 +57,8 @@
JS
1.0
-shared
fun shared(): Unit
+

shared

+
fun shared(): Unit
@@ -60,7 +67,8 @@
JS
1.1
-sharedNew (Since: 1.1)
fun sharedNew(): Unit
+

sharedNew

+
fun sharedNew(): Unit
-- cgit