From fc5496fb8bb888c3a50717260dc05d8fe2d54306 Mon Sep 17 00:00:00 2001 From: vmishenev Date: Wed, 1 Sep 2021 00:03:13 +0300 Subject: Improve versioning plugin (#2104) - support for single module projects - version navigator is on all pages - dropdown arrow for version navigator --- .../all-modules-page/src/main/kotlin/MultimoduleLocationProvider.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/all-modules-page/src/main/kotlin/MultimoduleLocationProvider.kt') 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) -- cgit