aboutsummaryrefslogtreecommitdiff
path: root/plugins/all-module-page/src/main/kotlin
diff options
context:
space:
mode:
authorPaweł Marks <pmarks@virtuslab.com>2020-10-07 19:36:49 +0200
committerBłażej Kardyś <bkardys@virtuslab.com>2020-11-27 03:15:02 +0100
commitd41965ca3cb180bc82bd5dd6fa747d2b83381b31 (patch)
tree5660f17f21fdf5871c8239f4d96c4521545292d1 /plugins/all-module-page/src/main/kotlin
parentdc179bf9a649d925e7e64dbcaf52a2187416a1d5 (diff)
downloaddokka-d41965ca3cb180bc82bd5dd6fa747d2b83381b31.tar.gz
dokka-d41965ca3cb180bc82bd5dd6fa747d2b83381b31.tar.bz2
dokka-d41965ca3cb180bc82bd5dd6fa747d2b83381b31.zip
Implement immediate temaplates resolution
Diffstat (limited to 'plugins/all-module-page/src/main/kotlin')
-rw-r--r--plugins/all-module-page/src/main/kotlin/MultimodulePageCreator.kt1
-rw-r--r--plugins/all-module-page/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt4
-rw-r--r--plugins/all-module-page/src/main/kotlin/templates/PathToRootSubstitutor.kt6
3 files changed, 4 insertions, 7 deletions
diff --git a/plugins/all-module-page/src/main/kotlin/MultimodulePageCreator.kt b/plugins/all-module-page/src/main/kotlin/MultimodulePageCreator.kt
index 3ad3e0ce..c3806b00 100644
--- a/plugins/all-module-page/src/main/kotlin/MultimodulePageCreator.kt
+++ b/plugins/all-module-page/src/main/kotlin/MultimodulePageCreator.kt
@@ -64,7 +64,6 @@ class MultimodulePageCreator(
}
}
return MultimoduleRootPageNode(
- "Modules",
setOf(DRI(packageName = MULTIMODULE_PACKAGE_PLACEHOLDER, classNames = "allModules")),
contentNode
)
diff --git a/plugins/all-module-page/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt b/plugins/all-module-page/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt
index d50cbc32..e609397b 100644
--- a/plugins/all-module-page/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt
+++ b/plugins/all-module-page/src/main/kotlin/templates/DirectiveBasedTemplateProcessing.kt
@@ -156,8 +156,8 @@ class DirectiveBasedTemplateProcessingStrategy(private val context: DokkaContext
return
}
- val modulePath = context.configuration.outputDir.absolutePath.split("/")
- val contextPath = fileContext.absolutePath.split("/")
+ val modulePath = context.configuration.outputDir.absolutePath.split(File.separator)
+ val contextPath = fileContext.absolutePath.split(File.separator)
val commonPathElements = modulePath.zip(contextPath)
.takeWhile { (a, b) -> a == b }.count()
diff --git a/plugins/all-module-page/src/main/kotlin/templates/PathToRootSubstitutor.kt b/plugins/all-module-page/src/main/kotlin/templates/PathToRootSubstitutor.kt
index 992ee7ed..5056b724 100644
--- a/plugins/all-module-page/src/main/kotlin/templates/PathToRootSubstitutor.kt
+++ b/plugins/all-module-page/src/main/kotlin/templates/PathToRootSubstitutor.kt
@@ -1,16 +1,14 @@
package org.jetbrains.dokka.allModulesPage.templates
-import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.templating.PathToRootSubstitutionCommand
import org.jetbrains.dokka.base.templating.SubstitutionCommand
import org.jetbrains.dokka.plugability.DokkaContext
-import org.jetbrains.dokka.plugability.query
-import java.nio.file.Path
+import java.io.File
class PathToRootSubstitutor(private val dokkaContext: DokkaContext) : Substitutor {
override fun trySubstitute(context: TemplatingContext<SubstitutionCommand>, match: MatchResult): String? =
if (context.command is PathToRootSubstitutionCommand) {
- context.output.toPath().parent.relativize(dokkaContext.configuration.outputDir.toPath()).toString() + "/"
+ context.output.toPath().parent.relativize(dokkaContext.configuration.outputDir.toPath()).toString().split(File.separator).joinToString(separator = "/", postfix = "/") { it }
} else null
} \ No newline at end of file