aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/api/core.api53
-rw-r--r--core/src/main/kotlin/pages/PageNodes.kt29
-rw-r--r--core/src/main/kotlin/pages/Pages.kt8
3 files changed, 63 insertions, 27 deletions
diff --git a/core/api/core.api b/core/api/core.api
index d3b4817b..063f56c5 100644
--- a/core/api/core.api
+++ b/core/api/core.api
@@ -3440,15 +3440,20 @@ public abstract interface class org/jetbrains/dokka/model/properties/WithExtraPr
public abstract fun withNewExtras (Lorg/jetbrains/dokka/model/properties/PropertyContainer;)Ljava/lang/Object;
}
-public abstract interface class org/jetbrains/dokka/pages/ClasslikePage : org/jetbrains/dokka/pages/ContentPage {
+public abstract interface class org/jetbrains/dokka/pages/ClasslikePage : org/jetbrains/dokka/pages/ContentPage, org/jetbrains/dokka/pages/WithDocumentables {
+}
+
+public final class org/jetbrains/dokka/pages/ClasslikePage$DefaultImpls {
+ public static fun getDocumentable (Lorg/jetbrains/dokka/pages/ClasslikePage;)Lorg/jetbrains/dokka/model/Documentable;
}
public final class org/jetbrains/dokka/pages/ClasslikePageNode : org/jetbrains/dokka/pages/ClasslikePage {
- public fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Lorg/jetbrains/dokka/model/Documentable;Ljava/util/List;Ljava/util/List;)V
- public synthetic fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Lorg/jetbrains/dokka/model/Documentable;Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
+ public fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Ljava/util/List;Ljava/util/List;Ljava/util/List;)V
+ public synthetic fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Ljava/util/List;Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun getChildren ()Ljava/util/List;
public fun getContent ()Lorg/jetbrains/dokka/pages/ContentNode;
public fun getDocumentable ()Lorg/jetbrains/dokka/model/Documentable;
+ public fun getDocumentables ()Ljava/util/List;
public fun getDri ()Ljava/util/Set;
public fun getEmbeddedResources ()Ljava/util/List;
public fun getName ()Ljava/lang/String;
@@ -3846,6 +3851,7 @@ public abstract interface class org/jetbrains/dokka/pages/ContentPage : org/jetb
}
public final class org/jetbrains/dokka/pages/ContentPage$DefaultImpls {
+ public static fun getDocumentable (Lorg/jetbrains/dokka/pages/ContentPage;)Lorg/jetbrains/dokka/model/Documentable;
public static synthetic fun modified$default (Lorg/jetbrains/dokka/pages/ContentPage;Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Ljava/util/List;Ljava/util/List;ILjava/lang/Object;)Lorg/jetbrains/dokka/pages/ContentPage;
}
@@ -3982,15 +3988,20 @@ public final class org/jetbrains/dokka/pages/ListStyle : java/lang/Enum, org/jet
public static fun values ()[Lorg/jetbrains/dokka/pages/ListStyle;
}
-public abstract interface class org/jetbrains/dokka/pages/MemberPage : org/jetbrains/dokka/pages/ContentPage {
+public abstract interface class org/jetbrains/dokka/pages/MemberPage : org/jetbrains/dokka/pages/ContentPage, org/jetbrains/dokka/pages/WithDocumentables {
+}
+
+public final class org/jetbrains/dokka/pages/MemberPage$DefaultImpls {
+ public static fun getDocumentable (Lorg/jetbrains/dokka/pages/MemberPage;)Lorg/jetbrains/dokka/model/Documentable;
}
public final class org/jetbrains/dokka/pages/MemberPageNode : org/jetbrains/dokka/pages/MemberPage {
- public fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Lorg/jetbrains/dokka/model/Documentable;Ljava/util/List;Ljava/util/List;)V
- public synthetic fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Lorg/jetbrains/dokka/model/Documentable;Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
+ public fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Ljava/util/List;Ljava/util/List;Ljava/util/List;)V
+ public synthetic fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Ljava/util/List;Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun getChildren ()Ljava/util/List;
public fun getContent ()Lorg/jetbrains/dokka/pages/ContentNode;
public fun getDocumentable ()Lorg/jetbrains/dokka/model/Documentable;
+ public fun getDocumentables ()Ljava/util/List;
public fun getDri ()Ljava/util/Set;
public fun getEmbeddedResources ()Ljava/util/List;
public fun getName ()Ljava/lang/String;
@@ -4000,15 +4011,20 @@ public final class org/jetbrains/dokka/pages/MemberPageNode : org/jetbrains/dokk
public fun modified (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Ljava/util/List;Ljava/util/List;)Lorg/jetbrains/dokka/pages/MemberPageNode;
}
-public abstract interface class org/jetbrains/dokka/pages/ModulePage : org/jetbrains/dokka/pages/ContentPage {
+public abstract interface class org/jetbrains/dokka/pages/ModulePage : org/jetbrains/dokka/pages/ContentPage, org/jetbrains/dokka/pages/WithDocumentables {
+}
+
+public final class org/jetbrains/dokka/pages/ModulePage$DefaultImpls {
+ public static fun getDocumentable (Lorg/jetbrains/dokka/pages/ModulePage;)Lorg/jetbrains/dokka/model/Documentable;
}
public final class org/jetbrains/dokka/pages/ModulePageNode : org/jetbrains/dokka/pages/RootPageNode, org/jetbrains/dokka/pages/ModulePage {
- public fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Lorg/jetbrains/dokka/model/Documentable;Ljava/util/List;Ljava/util/List;)V
- public synthetic fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Lorg/jetbrains/dokka/model/Documentable;Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
+ public fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/List;Ljava/util/List;Ljava/util/List;)V
+ public synthetic fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/List;Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun getChildren ()Ljava/util/List;
public fun getContent ()Lorg/jetbrains/dokka/pages/ContentNode;
public fun getDocumentable ()Lorg/jetbrains/dokka/model/Documentable;
+ public fun getDocumentables ()Ljava/util/List;
public fun getDri ()Ljava/util/Set;
public fun getEmbeddedResources ()Ljava/util/List;
public fun getName ()Ljava/lang/String;
@@ -4022,6 +4038,10 @@ public final class org/jetbrains/dokka/pages/ModulePageNode : org/jetbrains/dokk
public abstract interface class org/jetbrains/dokka/pages/MultimoduleRootPage : org/jetbrains/dokka/pages/ContentPage {
}
+public final class org/jetbrains/dokka/pages/MultimoduleRootPage$DefaultImpls {
+ public static fun getDocumentable (Lorg/jetbrains/dokka/pages/MultimoduleRootPage;)Lorg/jetbrains/dokka/model/Documentable;
+}
+
public final class org/jetbrains/dokka/pages/MultimoduleRootPageNode : org/jetbrains/dokka/pages/RootPageNode, org/jetbrains/dokka/pages/MultimoduleRootPage {
public fun <init> (Ljava/util/Set;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/List;)V
public synthetic fun <init> (Ljava/util/Set;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
@@ -4041,15 +4061,20 @@ public final class org/jetbrains/dokka/pages/MultimoduleTable : org/jetbrains/do
public static final field INSTANCE Lorg/jetbrains/dokka/pages/MultimoduleTable;
}
-public abstract interface class org/jetbrains/dokka/pages/PackagePage : org/jetbrains/dokka/pages/ContentPage {
+public abstract interface class org/jetbrains/dokka/pages/PackagePage : org/jetbrains/dokka/pages/ContentPage, org/jetbrains/dokka/pages/WithDocumentables {
+}
+
+public final class org/jetbrains/dokka/pages/PackagePage$DefaultImpls {
+ public static fun getDocumentable (Lorg/jetbrains/dokka/pages/PackagePage;)Lorg/jetbrains/dokka/model/Documentable;
}
public final class org/jetbrains/dokka/pages/PackagePageNode : org/jetbrains/dokka/pages/PackagePage {
- public fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Lorg/jetbrains/dokka/model/Documentable;Ljava/util/List;Ljava/util/List;)V
- public synthetic fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Lorg/jetbrains/dokka/model/Documentable;Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
+ public fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Ljava/util/List;Ljava/util/List;Ljava/util/List;)V
+ public synthetic fun <init> (Ljava/lang/String;Lorg/jetbrains/dokka/pages/ContentNode;Ljava/util/Set;Ljava/util/List;Ljava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun getChildren ()Ljava/util/List;
public fun getContent ()Lorg/jetbrains/dokka/pages/ContentNode;
public fun getDocumentable ()Lorg/jetbrains/dokka/model/Documentable;
+ public fun getDocumentables ()Ljava/util/List;
public fun getDri ()Ljava/util/Set;
public fun getEmbeddedResources ()Ljava/util/List;
public fun getName ()Ljava/lang/String;
@@ -4264,6 +4289,10 @@ public final class org/jetbrains/dokka/pages/UtilsKt {
public static final fun recursiveMapTransform (Lorg/jetbrains/dokka/pages/ContentNode;Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;)Lorg/jetbrains/dokka/pages/ContentNode;
}
+public abstract interface class org/jetbrains/dokka/pages/WithDocumentables {
+ public abstract fun getDocumentables ()Ljava/util/List;
+}
+
public final class org/jetbrains/dokka/pages/WrongRendererTypeException : java/lang/Exception {
public fun <init> (Lkotlin/reflect/KClass;)V
public final fun component1 ()Lkotlin/reflect/KClass;
diff --git a/core/src/main/kotlin/pages/PageNodes.kt b/core/src/main/kotlin/pages/PageNodes.kt
index 9fc4d6e8..75e27dcc 100644
--- a/core/src/main/kotlin/pages/PageNodes.kt
+++ b/core/src/main/kotlin/pages/PageNodes.kt
@@ -18,9 +18,14 @@ interface PageNode : WithChildren<PageNode> {
interface ContentPage : PageNode {
val content: ContentNode
val dri: Set<DRI>
- val documentable: Documentable?
val embeddedResources: List<String>
+ @Deprecated("Deprecated. Remove its usages from your code.",
+ ReplaceWith("documentables.firstOrNull()")
+ )
+ val documentable: Documentable?
+ get() = if (this is WithDocumentables) this.documentables.firstOrNull() else null
+
fun modified(
name: String = this.name,
content: ContentNode = this.content,
@@ -30,6 +35,10 @@ interface ContentPage : PageNode {
): ContentPage
}
+interface WithDocumentables {
+ val documentables: List<Documentable>
+}
+
abstract class RootPageNode(val forceTopLevelName: Boolean = false) : PageNode {
val parentMap: Map<PageNode, PageNode> by lazy {
IdentityHashMap<PageNode, PageNode>().apply {
@@ -64,7 +73,7 @@ abstract class RootPageNode(val forceTopLevelName: Boolean = false) : PageNode {
class ModulePageNode(
override val name: String,
override val content: ContentNode,
- override val documentable: Documentable?,
+ override val documentables: List<Documentable> = listOf(),
override val children: List<PageNode>,
override val embeddedResources: List<String> = listOf()
) : RootPageNode(), ModulePage {
@@ -81,14 +90,14 @@ class ModulePageNode(
children: List<PageNode>
): ModulePageNode =
if (name == this.name && content === this.content && embeddedResources === this.embeddedResources && children shallowEq this.children) this
- else ModulePageNode(name, content, documentable, children, embeddedResources)
+ else ModulePageNode(name, content, documentables, children, embeddedResources)
}
class PackagePageNode(
override val name: String,
override val content: ContentNode,
override val dri: Set<DRI>,
- override val documentable: Documentable?,
+ override val documentables: List<Documentable> = listOf(),
override val children: List<PageNode>,
override val embeddedResources: List<String> = listOf()
) : PackagePage {
@@ -108,14 +117,14 @@ class PackagePageNode(
children: List<PageNode>
): PackagePageNode =
if (name == this.name && content === this.content && embeddedResources === this.embeddedResources && children shallowEq this.children) this
- else PackagePageNode(name, content, dri, documentable, children, embeddedResources)
+ else PackagePageNode(name, content, dri, documentables, children, embeddedResources)
}
class ClasslikePageNode(
override val name: String,
override val content: ContentNode,
override val dri: Set<DRI>,
- override val documentable: Documentable?,
+ override val documentables: List<Documentable> = listOf(),
override val children: List<PageNode>,
override val embeddedResources: List<String> = listOf()
) : ClasslikePage {
@@ -130,14 +139,14 @@ class ClasslikePageNode(
children: List<PageNode>
): ClasslikePageNode =
if (name == this.name && content === this.content && embeddedResources === this.embeddedResources && children shallowEq this.children) this
- else ClasslikePageNode(name, content, dri, documentable, children, embeddedResources)
+ else ClasslikePageNode(name, content, dri, documentables, children, embeddedResources)
}
class MemberPageNode(
override val name: String,
override val content: ContentNode,
override val dri: Set<DRI>,
- override val documentable: Documentable?,
+ override val documentables: List<Documentable> = listOf(),
override val children: List<PageNode> = emptyList(),
override val embeddedResources: List<String> = listOf()
) : MemberPage {
@@ -152,7 +161,7 @@ class MemberPageNode(
children: List<PageNode>
): MemberPageNode =
if (name == this.name && content === this.content && embeddedResources === this.embeddedResources && children shallowEq this.children) this
- else MemberPageNode(name, content, dri, documentable, children, embeddedResources)
+ else MemberPageNode(name, content, dri, documentables, children, embeddedResources)
}
@@ -165,8 +174,6 @@ class MultimoduleRootPageNode(
override val children: List<PageNode> = emptyList()
- override val documentable: Documentable? = null
-
override fun modified(name: String, children: List<PageNode>): RootPageNode =
MultimoduleRootPageNode(dri, content, embeddedResources)
diff --git a/core/src/main/kotlin/pages/Pages.kt b/core/src/main/kotlin/pages/Pages.kt
index b65e72d6..90ae09e8 100644
--- a/core/src/main/kotlin/pages/Pages.kt
+++ b/core/src/main/kotlin/pages/Pages.kt
@@ -2,10 +2,10 @@ package org.jetbrains.dokka.pages
interface MultimoduleRootPage : ContentPage
-interface ModulePage : ContentPage
+interface ModulePage : ContentPage, WithDocumentables
-interface PackagePage : ContentPage
+interface PackagePage : ContentPage, WithDocumentables
-interface ClasslikePage : ContentPage
+interface ClasslikePage : ContentPage, WithDocumentables
-interface MemberPage : ContentPage \ No newline at end of file
+interface MemberPage : ContentPage, WithDocumentables \ No newline at end of file