aboutsummaryrefslogtreecommitdiff
path: root/plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt
diff options
context:
space:
mode:
authorBłażej Kardyś <bkardys@virtuslab.com>2020-11-16 19:46:31 +0100
committerBłażej Kardyś <bkardys@virtuslab.com>2020-11-27 03:15:02 +0100
commit076a5f421c5e4621539efd814be612f43fef33f5 (patch)
tree90b399c459cccbd1e3010778320d49b7b806b1fb /plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt
parentc203be9fb65ee221875b4e1c865bcd289a85e69c (diff)
downloaddokka-076a5f421c5e4621539efd814be612f43fef33f5.tar.gz
dokka-076a5f421c5e4621539efd814be612f43fef33f5.tar.bz2
dokka-076a5f421c5e4621539efd814be612f43fef33f5.zip
Adding inter-module link resolving template strategy for Gfm
Diffstat (limited to 'plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt')
-rw-r--r--plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt7
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt b/plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt
index 1e7fb60c..cb1eca7b 100644
--- a/plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt
+++ b/plugins/all-module-page/src/main/kotlin/MultimoduleLocationProvider.kt
@@ -10,17 +10,16 @@ import org.jetbrains.dokka.pages.PageNode
import org.jetbrains.dokka.pages.RootPageNode
import org.jetbrains.dokka.plugability.DokkaContext
-class MultimoduleLocationProvider(private val root: RootPageNode, context: DokkaContext) : DokkaBaseLocationProvider(root, context, ".html") {
-
- private val defaultLocationProvider = DokkaLocationProvider(root, context)
+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.html"
+ "$it/${identifierToFilename(dri.classNames.orEmpty())}/index$fileExtension"
} ?: defaultLocationProvider.resolve(dri, sourceSets, context)
override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean) =