aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/pages/PageNodes.kt
diff options
context:
space:
mode:
authorPaweł Marks <pmarks@virtuslab.com>2020-10-07 19:36:49 +0200
committerBłażej Kardyś <bkardys@virtuslab.com>2020-11-27 03:15:02 +0100
commitd41965ca3cb180bc82bd5dd6fa747d2b83381b31 (patch)
tree5660f17f21fdf5871c8239f4d96c4521545292d1 /core/src/main/kotlin/pages/PageNodes.kt
parentdc179bf9a649d925e7e64dbcaf52a2187416a1d5 (diff)
downloaddokka-d41965ca3cb180bc82bd5dd6fa747d2b83381b31.tar.gz
dokka-d41965ca3cb180bc82bd5dd6fa747d2b83381b31.tar.bz2
dokka-d41965ca3cb180bc82bd5dd6fa747d2b83381b31.zip
Implement immediate temaplates resolution
Diffstat (limited to 'core/src/main/kotlin/pages/PageNodes.kt')
-rw-r--r--core/src/main/kotlin/pages/PageNodes.kt10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/src/main/kotlin/pages/PageNodes.kt b/core/src/main/kotlin/pages/PageNodes.kt
index a91887b4..94ec8258 100644
--- a/core/src/main/kotlin/pages/PageNodes.kt
+++ b/core/src/main/kotlin/pages/PageNodes.kt
@@ -30,7 +30,7 @@ interface ContentPage : PageNode {
): ContentPage
}
-abstract class RootPageNode : PageNode {
+abstract class RootPageNode(val forceTopLevelName: Boolean = false) : PageNode {
val parentMap: Map<PageNode, PageNode> by lazy {
IdentityHashMap<PageNode, PageNode>().apply {
fun process(parent: PageNode) {
@@ -157,18 +157,18 @@ class MemberPageNode(
class MultimoduleRootPageNode(
- override val name: String,
override val dri: Set<DRI>,
override val content: ContentNode,
override val embeddedResources: List<String> = emptyList()
-) : RootPageNode(), MultimoduleRootPage {
+) : RootPageNode(forceTopLevelName = true), MultimoduleRootPage {
+ override val name = ""
override val children: List<PageNode> = emptyList()
override val documentable: Documentable? = null
override fun modified(name: String, children: List<PageNode>): RootPageNode =
- MultimoduleRootPageNode(name, dri, content, embeddedResources)
+ MultimoduleRootPageNode(dri, content, embeddedResources)
override fun modified(
name: String,
@@ -178,7 +178,7 @@ class MultimoduleRootPageNode(
children: List<PageNode>
) =
if (name == this.name && content === this.content && embeddedResources === this.embeddedResources && children shallowEq this.children) this
- else MultimoduleRootPageNode(name, dri, content, embeddedResources)
+ else MultimoduleRootPageNode(dri, content, embeddedResources)
}
inline fun <reified T : PageNode> PageNode.children() = children.filterIsInstance<T>()