aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt33
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt6
2 files changed, 22 insertions, 17 deletions
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt
index 24719ebf..7bc6d6d8 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt
@@ -32,32 +32,37 @@ interface WithBrief {
}
class JavadocModulePageNode(
- name: String,
- content: JavadocContentNode,
- children: List<PageNode>,
+ override val name: String,
+ override val content: JavadocContentNode,
+ override val children: List<PageNode>,
override val dri: Set<DRI>
) :
- ModulePageNode(name, content, null, children, emptyList()),
+ RootPageNode(),
JavadocPageNode {
+ override val documentable: Documentable? = null
+ override val embeddedResources: List<String> = emptyList()
+ override fun modified(name: String, children: List<PageNode>): RootPageNode =
+ JavadocModulePageNode(name, content, children, dri)
+
override fun modified(
name: String,
content: ContentNode,
dri: Set<DRI>,
embeddedResources: List<String>,
children: List<PageNode>
- ): ModulePageNode = JavadocModulePageNode(name, content as JavadocContentNode, children, dri)
+ ): ContentPage = JavadocModulePageNode(name, content as JavadocContentNode, children, dri)
}
class JavadocPackagePageNode(
- name: String,
- content: JavadocContentNode,
- dri: Set<DRI>,
+ override val name: String,
+ override val content: JavadocContentNode,
+ override val dri: Set<DRI>,
- documentable: Documentable? = null,
- children: List<PageNode> = emptyList(),
- embeddedResources: List<String> = listOf()
-) : JavadocPageNode, WithIndexables, IndexableJavadocNode, PackagePageNode(name, content, dri, documentable, children, embeddedResources) {
+ override val documentable: Documentable? = null,
+ override val children: List<PageNode> = emptyList(),
+ override val embeddedResources: List<String> = listOf()
+) : JavadocPageNode, WithIndexables, IndexableJavadocNode {
override fun getAllIndexables(): List<IndexableJavadocNode> =
children.filterIsInstance<IndexableJavadocNode>().flatMap {
@@ -68,7 +73,7 @@ class JavadocPackagePageNode(
override fun modified(
name: String,
children: List<PageNode>
- ): PackagePageNode = JavadocPackagePageNode(
+ ): PageNode = JavadocPackagePageNode(
name,
content,
dri,
@@ -83,7 +88,7 @@ class JavadocPackagePageNode(
dri: Set<DRI>,
embeddedResources: List<String>,
children: List<PageNode>
- ): PackagePageNode =
+ ): ContentPage =
JavadocPackagePageNode(
name,
content as JavadocContentNode,
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt
index 0c2d8e07..9e599285 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt
@@ -58,7 +58,7 @@ class SearchScriptsCreator(private val locationProvider: LocationProvider) {
val modules = SearchData(moduleRecords = input.map {
SearchRecord(
l = it.name,
- url = locationProvider.resolve(it).formatToEndWithHtml()
+ url = locationProvider.resolveOrThrow(it).formatToEndWithHtml()
)
})
val processablePackages = input.flatMap { it.children.filterIsInstance<JavadocPackagePageNode>() }
@@ -69,7 +69,7 @@ class SearchScriptsCreator(private val locationProvider: LocationProvider) {
val packages = input.map {
SearchRecord(
l = it.name,
- url = locationProvider.resolve(it).formatToEndWithHtml()
+ url = locationProvider.resolveOrThrow(it).formatToEndWithHtml()
)
} + SearchRecord.allPackages
val types = input.flatMap {
@@ -87,7 +87,7 @@ class SearchScriptsCreator(private val locationProvider: LocationProvider) {
SearchRecord(
p = it.first.name,
l = it.second.name,
- url = locationProvider.resolve(it.second).formatToEndWithHtml()
+ url = locationProvider.resolveOrThrow(it.second).formatToEndWithHtml()
)
} + allTypes
val updated = accumulator.copy(typeRecords = types)