aboutsummaryrefslogtreecommitdiff
path: root/plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt')
-rw-r--r--plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt40
1 files changed, 0 insertions, 40 deletions
diff --git a/plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt b/plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt
deleted file mode 100644
index cb1eca7b..00000000
--- a/plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.jetbrains.dokka.allModulesPage
-
-import org.jetbrains.dokka.base.resolvers.local.DokkaBaseLocationProvider
-import org.jetbrains.dokka.base.resolvers.local.DokkaLocationProvider
-import org.jetbrains.dokka.base.resolvers.local.DokkaLocationProvider.Companion.identifierToFilename
-import org.jetbrains.dokka.base.resolvers.local.LocationProviderFactory
-import org.jetbrains.dokka.links.DRI
-import org.jetbrains.dokka.model.DisplaySourceSet
-import org.jetbrains.dokka.pages.PageNode
-import org.jetbrains.dokka.pages.RootPageNode
-import org.jetbrains.dokka.plugability.DokkaContext
-
-open class MultimoduleLocationProvider(private val root: RootPageNode, val context: DokkaContext, private val fileExtension: String = ".html") : DokkaBaseLocationProvider(root, context, fileExtension) {
-
- protected open val defaultLocationProvider = DokkaLocationProvider(root, context)
- val paths = context.configuration.modules.map {
- it.name to it.relativePathToOutputDirectory
- }.toMap()
-
- override fun resolve(dri: DRI, sourceSets: Set<DisplaySourceSet>, context: PageNode?) =
- dri.takeIf { it.packageName == MULTIMODULE_PACKAGE_PLACEHOLDER }?.classNames?.let { paths[it] }?.let {
- "$it/${identifierToFilename(dri.classNames.orEmpty())}/index$fileExtension"
- } ?: defaultLocationProvider.resolve(dri, sourceSets, context)
-
- override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean) =
- defaultLocationProvider.resolve(node, context, skipExtension)
-
- override fun pathToRoot(from: PageNode): String = defaultLocationProvider.pathToRoot(from)
-
- override fun ancestors(node: PageNode): List<PageNode> = listOf(root)
-
- companion object {
- const val MULTIMODULE_PACKAGE_PLACEHOLDER = ".ext"
- }
-
- class Factory(private val context: DokkaContext): LocationProviderFactory {
- override fun getLocationProvider(pageNode: RootPageNode) =
- MultimoduleLocationProvider(pageNode, context)
- }
-}