aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Formats
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2019-05-07 14:30:25 +0200
committerKamil Doległo <kamilok1965@interia.pl>2019-05-07 14:33:31 +0200
commitd1937ab65bef189a48a55218a4194c0afb778053 (patch)
treea7d42b085d6bf64ebedefebe81febdc83a82d408 /core/src/main/kotlin/Formats
parentd2777df57ac81a69ab78e982adda2cedcb2d5e8d (diff)
downloaddokka-d1937ab65bef189a48a55218a4194c0afb778053.tar.gz
dokka-d1937ab65bef189a48a55218a4194c0afb778053.tar.bz2
dokka-d1937ab65bef189a48a55218a4194c0afb778053.zip
Fix some tests
Diffstat (limited to 'core/src/main/kotlin/Formats')
-rw-r--r--core/src/main/kotlin/Formats/MarkdownFormatService.kt24
-rw-r--r--core/src/main/kotlin/Formats/StructuredFormatService.kt13
2 files changed, 20 insertions, 17 deletions
diff --git a/core/src/main/kotlin/Formats/MarkdownFormatService.kt b/core/src/main/kotlin/Formats/MarkdownFormatService.kt
index 4265394f..71356619 100644
--- a/core/src/main/kotlin/Formats/MarkdownFormatService.kt
+++ b/core/src/main/kotlin/Formats/MarkdownFormatService.kt
@@ -159,16 +159,20 @@ open class MarkdownOutputBuilder(to: StringBuilder,
}
override fun appendParagraph(body: () -> Unit) {
- if (inTableCell) {
- ensureNewline()
- body()
- } else if (listStack.isNotEmpty()) {
- body()
- ensureNewline()
- } else {
- ensureParagraph()
- body()
- ensureParagraph()
+ when {
+ inTableCell -> {
+ ensureNewline()
+ body()
+ }
+ listStack.isNotEmpty() -> {
+ body()
+ ensureNewline()
+ }
+ else -> {
+ ensureParagraph()
+ body()
+ ensureParagraph()
+ }
}
}
diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt
index 44b06e8b..a6c1b57f 100644
--- a/core/src/main/kotlin/Formats/StructuredFormatService.kt
+++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt
@@ -111,7 +111,7 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
open fun appendSinceKotlin(version: String) {
appendParagraph {
- appendText("Available since Kotlin: ")
+ appendText("Since: ")
appendCode { appendText(version) }
}
}
@@ -280,15 +280,13 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
protected open fun appendPlatformsAsText(platforms: PlatformsData) {
if (platforms.isNotEmpty()) {
- appendLine()
- appendText(platforms.keys.joinToString(prefix = "(", postfix = ")"))
+ appendText(platforms.keys.joinToString(prefix = "(", postfix = ") "))
}
}
protected open fun appendPlatforms(platforms: PlatformsData) {
if (platforms.isNotEmpty()) {
- appendLine()
- appendText(platforms.keys.joinToString(prefix = "(", postfix = ")"))
+ appendText(platforms.keys.joinToString(prefix = "(", postfix = ") "))
}
}
@@ -775,9 +773,10 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
appendPlatforms(platforms)
}
// appendHeader(level = 4) {
- appendParagraph {
+// appendParagraph {
appendLink(memberLocation)
- }
+
+// }
// if (members.singleOrNull()?.kind != NodeKind.ExternalClass) {
// appendPlatforms(platforms)
// }