aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/base-test-utils/src/main/kotlin
diff options
context:
space:
mode:
authorMarcin Aman <maman@virtuslab.com>2020-09-03 10:24:44 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-09-07 08:07:10 +0200
commit495c64c64db5d7ebc44a7262e5bdeb7cc3a54f9c (patch)
tree41cad978990b52f84906e1effb87d472ce2c784c /plugins/base/base-test-utils/src/main/kotlin
parent581d064dc1fba01fd27f560e158df48498c7e776 (diff)
downloaddokka-495c64c64db5d7ebc44a7262e5bdeb7cc3a54f9c.tar.gz
dokka-495c64c64db5d7ebc44a7262e5bdeb7cc3a54f9c.tar.bz2
dokka-495c64c64db5d7ebc44a7262e5bdeb7cc3a54f9c.zip
Test images in GFM
Diffstat (limited to 'plugins/base/base-test-utils/src/main/kotlin')
-rw-r--r--plugins/base/base-test-utils/src/main/kotlin/renderers/TestPage.kt28
1 files changed, 16 insertions, 12 deletions
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<DRI> = setOf(DRI.topLevel)
- override val documentable: Documentable? = null
- override val embeddedResources: List<String> = emptyList()
- override val name: String
- get() = "testPage"
- override val children: List<PageNode>
- 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<DRI> = setOf(DRI.topLevel),
+ override val documentable: Documentable? = null,
+ override val embeddedResources: List<String> = emptyList(),
+ override val children: List<PageNode> = emptyList(),
+): RootPageNode(), ContentPage {
override fun modified(
name: String,
content: ContentNode,
dri: Set<DRI>,
embeddedResources: List<String>,
children: List<PageNode>
- ) = this
+ ): ContentPage = this
+
+ override fun modified(name: String, children: List<PageNode>): RootPageNode = this
- override fun modified(name: String, children: List<PageNode>) = this
}
internal object EmptyCommentConverter : CommentsToContentConverter {