From 663d8e04dc78ce9bfe02cb1e84f27faab1e34208 Mon Sep 17 00:00:00 2001 From: Szymon Świstun Date: Tue, 28 Jan 2020 14:22:11 +0100 Subject: contentForClass fixed and tests --- core/src/main/kotlin/pages/PageBuilder.kt | 7 ++++++ core/src/test/kotlin/basic/DokkaBasicTests.kt | 35 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 core/src/test/kotlin/basic/DokkaBasicTests.kt (limited to 'core/src') diff --git a/core/src/main/kotlin/pages/PageBuilder.kt b/core/src/main/kotlin/pages/PageBuilder.kt index 003cc815..7fe07ae4 100644 --- a/core/src/main/kotlin/pages/PageBuilder.kt +++ b/core/src/main/kotlin/pages/PageBuilder.kt @@ -70,6 +70,7 @@ class DefaultPageBuilder( private fun contentForClass(c: Class) = group(c) { header(1) { text(c.name) } + c.inherited.takeIf { it.isNotEmpty() }?.let { header(2) { text("SuperInterfaces") } linkTable(it) @@ -83,6 +84,12 @@ class DefaultPageBuilder( comment(it.root) text("\n") } + contentForComments(c) + block("Constructors", 2, ContentKind.Functions, c.constructors, c.platformData) { + link(it.name, it.dri) + signature(it) + text(it.briefDocTagString) + } block("Functions", 2, ContentKind.Functions, c.functions, c.platformData) { link(it.name, it.dri) diff --git a/core/src/test/kotlin/basic/DokkaBasicTests.kt b/core/src/test/kotlin/basic/DokkaBasicTests.kt new file mode 100644 index 00000000..d418e36a --- /dev/null +++ b/core/src/test/kotlin/basic/DokkaBasicTests.kt @@ -0,0 +1,35 @@ +package basic + +import org.junit.Test +import testApi.testRunner.AbstractCoreTest + +class DokkaBasicTests : AbstractCoreTest() { + + @Test + fun basic1() { + val configuration = dokkaConfiguration { + passes { + pass { + sourceRoots = listOf("src/main/kotlin/basic/Test.kt") + } + } + } + + testInline( + """ + |/src/main/kotlin/basic/Test.kt + |package basic + | + |class Test { + | val tI = 1 + | fun tF() = 2 + |} + """.trimMargin(), + configuration + ) { + pagesGenerationStage = { + println(it.dri) + } + } + } +} \ No newline at end of file -- cgit