aboutsummaryrefslogtreecommitdiff
path: root/plugins/all-modules-page/src/main/kotlin/AllModulesPageGeneration.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/AllModulesPageGeneration.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/AllModulesPageGeneration.kt')
-rw-r--r--plugins/all-modules-page/src/main/kotlin/AllModulesPageGeneration.kt14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/all-modules-page/src/main/kotlin/AllModulesPageGeneration.kt b/plugins/all-modules-page/src/main/kotlin/AllModulesPageGeneration.kt
index 21c624ef..8558750e 100644
--- a/plugins/all-modules-page/src/main/kotlin/AllModulesPageGeneration.kt
+++ b/plugins/all-modules-page/src/main/kotlin/AllModulesPageGeneration.kt
@@ -11,13 +11,11 @@ import org.jetbrains.dokka.plugability.querySingle
import org.jetbrains.dokka.templates.TemplatingPlugin
import org.jetbrains.dokka.templates.TemplatingResult
import org.jetbrains.dokka.transformers.pages.CreationContext
-import org.jetbrains.dokka.versioning.VersioningPlugin
class AllModulesPageGeneration(private val context: DokkaContext) : Generation {
private val allModulesPagePlugin by lazy { context.plugin<AllModulesPagePlugin>() }
private val templatingPlugin by lazy { context.plugin<TemplatingPlugin>() }
- private val versioningPlugin by lazy { context.plugin<VersioningPlugin>() }
override fun Timer.generate() {
report("Processing submodules")
@@ -26,9 +24,6 @@ class AllModulesPageGeneration(private val context: DokkaContext) : Generation {
report("Creating all modules page")
val pages = createAllModulesPage(generationContext)
- report("Copy previous documentation")
- handlePreviousDocs()
-
report("Transforming pages")
val transformedPages = transformAllModulesPage(pages)
@@ -40,12 +35,13 @@ class AllModulesPageGeneration(private val context: DokkaContext) : Generation {
report("Finish submodule processing")
finishProcessingSubmodules()
+
+ report("Running post-actions")
+ runPostActions()
}
override val generationName = "index page for project"
- fun handlePreviousDocs() = versioningPlugin.querySingle { versioningHandler }.invoke()
-
fun createAllModulesPage(allModulesContext: DefaultAllModulesContext) =
allModulesPagePlugin.querySingle { allModulesPageCreator }.invoke(allModulesContext)
@@ -56,6 +52,10 @@ class AllModulesPageGeneration(private val context: DokkaContext) : Generation {
context.single(CoreExtensions.renderer).render(transformedPages)
}
+ fun runPostActions() {
+ context[CoreExtensions.postActions].forEach { it() }
+ }
+
fun processSubmodules() =
templatingPlugin.querySingle { submoduleTemplateProcessor }
.process(context.configuration.modules)