From bebbee81476e6996064f49f2dbe5b41d3b2cf65a Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 31 Mar 2016 19:58:06 +0200 Subject: Correctly format code samples in overload groups. Resolves #55 --- .../main/kotlin/Formats/KotlinWebsiteFormatService.kt | 3 ++- .../src/test/kotlin/format/KotlinWebSiteFormatTest.kt | 19 +++++++++++++++++++ core/src/test/kotlin/format/MarkdownFormatTest.kt | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt (limited to 'core/src') diff --git a/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt b/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt index 14157cff..9a739216 100644 --- a/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt +++ b/core/src/main/kotlin/Formats/KotlinWebsiteFormatService.kt @@ -51,7 +51,8 @@ class KotlinWebsiteFormatService @Inject constructor(locationService: LocationSe } override fun appendAsOverloadGroup(to: StringBuilder, block: () -> Unit) { - div(to, "overload-group", block) + block() + to.append("
") } override fun formatLink(text: String, href: String): String { diff --git a/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt new file mode 100644 index 00000000..a96139fd --- /dev/null +++ b/core/src/test/kotlin/format/KotlinWebSiteFormatTest.kt @@ -0,0 +1,19 @@ +package org.jetbrains.dokka.tests + +import org.jetbrains.dokka.KotlinLanguageService +import org.jetbrains.dokka.KotlinWebsiteFormatService +import org.junit.Test + +class KotlinWebSiteFormatTest { + private val kwsService = KotlinWebsiteFormatService(InMemoryLocationService, KotlinLanguageService()) + + @Test fun sample() { + verifyKWSNodeByName("sample", "foo") + } + + private fun verifyKWSNodeByName(fileName: String, name: String) { + verifyOutput("testdata/format/website/$fileName.kt", ".md") { model, output -> + kwsService.appendNodes(tempLocation, output, model.members.single().members.filter { it.name == name }) + } + } +} diff --git a/core/src/test/kotlin/format/MarkdownFormatTest.kt b/core/src/test/kotlin/format/MarkdownFormatTest.kt index f306ac74..15be6c77 100644 --- a/core/src/test/kotlin/format/MarkdownFormatTest.kt +++ b/core/src/test/kotlin/format/MarkdownFormatTest.kt @@ -4,7 +4,7 @@ import org.jetbrains.dokka.KotlinLanguageService import org.jetbrains.dokka.MarkdownFormatService import org.junit.Test -public class MarkdownFormatTest { +class MarkdownFormatTest { private val markdownService = MarkdownFormatService(InMemoryLocationService, KotlinLanguageService()) @Test fun emptyDescription() { -- cgit