From 495c64c64db5d7ebc44a7262e5bdeb7cc3a54f9c Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Thu, 3 Sep 2020 10:24:44 +0200 Subject: Test images in GFM --- .../src/main/kotlin/renderers/TestPage.kt | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'plugins/base/base-test-utils/src/main') diff --git a/plugins/base/base-test-utils/src/main/kotlin/renderers/TestPage.kt b/plugins/base/base-test-utils/src/main/kotlin/renderers/TestPage.kt index 0dae8ce6..09ea6083 100644 --- a/plugins/base/base-test-utils/src/main/kotlin/renderers/TestPage.kt +++ b/plugins/base/base-test-utils/src/main/kotlin/renderers/TestPage.kt @@ -11,16 +11,8 @@ import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder import org.jetbrains.dokka.base.signatures.KotlinSignatureProvider import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter -class TestPage(callback: PageContentBuilder.DocumentableContentBuilder.() -> Unit) : RootPageNode(), ContentPage { - override val dri: Set = setOf(DRI.topLevel) - override val documentable: Documentable? = null - override val embeddedResources: List = emptyList() - override val name: String - get() = "testPage" - override val children: List - get() = emptyList() - - override val content: ContentNode = PageContentBuilder( +fun testPage(callback: PageContentBuilder.DocumentableContentBuilder.() -> Unit): RawTestPage { + val content = PageContentBuilder( EmptyCommentConverter, KotlinSignatureProvider(EmptyCommentConverter, DokkaConsoleLogger), DokkaConsoleLogger @@ -30,15 +22,27 @@ class TestPage(callback: PageContentBuilder.DocumentableContentBuilder.() -> Uni block = callback ) + return RawTestPage(content) +} + +class RawTestPage( + override val content: ContentNode, + override val name: String = "testPage", + override val dri: Set = setOf(DRI.topLevel), + override val documentable: Documentable? = null, + override val embeddedResources: List = emptyList(), + override val children: List = emptyList(), +): RootPageNode(), ContentPage { override fun modified( name: String, content: ContentNode, dri: Set, embeddedResources: List, children: List - ) = this + ): ContentPage = this + + override fun modified(name: String, children: List): RootPageNode = this - override fun modified(name: String, children: List) = this } internal object EmptyCommentConverter : CommentsToContentConverter { -- cgit