aboutsummaryrefslogtreecommitdiff
path: root/plugins/all-modules-page/src/main/kotlin/MultimoduleLocationProvider.kt
diff options
context:
space:
mode:
authorvmishenev <vad-mishenev@yandex.ru>2021-09-01 00:03:13 +0300
committervmishenev <vad-mishenev@yandex.ru>2021-09-20 19:01:44 +0300
commitfc5496fb8bb888c3a50717260dc05d8fe2d54306 (patch)
tree2b61c01babe696065c4b8bafad61cce7479561ad /plugins/all-modules-page/src/main/kotlin/MultimoduleLocationProvider.kt
parent8efe04e127e3bf0aef395b31f3f3d9f49a0afe26 (diff)
downloaddokka-fc5496fb8bb888c3a50717260dc05d8fe2d54306.tar.gz
dokka-fc5496fb8bb888c3a50717260dc05d8fe2d54306.tar.bz2
dokka-fc5496fb8bb888c3a50717260dc05d8fe2d54306.zip
Improve versioning plugin (#2104)
- support for single module projects - version navigator is on all pages - dropdown arrow for version navigator
Diffstat (limited to 'plugins/all-modules-page/src/main/kotlin/MultimoduleLocationProvider.kt')
-rw-r--r--plugins/all-modules-page/src/main/kotlin/MultimoduleLocationProvider.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/all-modules-page/src/main/kotlin/MultimoduleLocationProvider.kt b/plugins/all-modules-page/src/main/kotlin/MultimoduleLocationProvider.kt
index 1a323f63..dab5be09 100644
--- a/plugins/all-modules-page/src/main/kotlin/MultimoduleLocationProvider.kt
+++ b/plugins/all-modules-page/src/main/kotlin/MultimoduleLocationProvider.kt
@@ -12,7 +12,8 @@ import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.plugability.plugin
import org.jetbrains.dokka.plugability.querySingle
-open class MultimoduleLocationProvider(private val root: RootPageNode, dokkaContext: DokkaContext) :
+open class MultimoduleLocationProvider(private val root: RootPageNode, dokkaContext: DokkaContext,
+ val extension: String = ".html") :
DokkaBaseLocationProvider(root, dokkaContext) {
private val defaultLocationProvider =
@@ -27,7 +28,7 @@ open class MultimoduleLocationProvider(private val root: RootPageNode, dokkaCont
?.let(externalModuleLinkResolver::resolveLinkToModuleIndex)
override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean) =
- if (node is ContentPage && MultimodulePageCreator.MULTIMODULE_ROOT_DRI in node.dri) pathToRoot(root) + "index"
+ if (node is ContentPage && MultimodulePageCreator.MULTIMODULE_ROOT_DRI in node.dri) pathToRoot(root) + "index" + if (!skipExtension) extension else ""
else defaultLocationProvider.resolve(node, context, skipExtension)
override fun pathToRoot(from: PageNode): String = defaultLocationProvider.pathToRoot(from)