aboutsummaryrefslogtreecommitdiff
path: root/plugins/all-modules-page/src/main/kotlin/MultimodulePageCreator.kt
diff options
context:
space:
mode:
authorBłażej Kardyś <bkardys@virtuslab.com>2021-01-05 17:59:38 +0100
committerGitHub <noreply@github.com>2021-01-05 17:59:38 +0100
commit1618e552c136e25d86bf0708e0d760841c77c139 (patch)
treec608ce91b020bb0ecbfe75d0f456a0eae84b4c51 /plugins/all-modules-page/src/main/kotlin/MultimodulePageCreator.kt
parentef98e4b6505c3fdd192b1d5057c718079d27b972 (diff)
downloaddokka-1618e552c136e25d86bf0708e0d760841c77c139.tar.gz
dokka-1618e552c136e25d86bf0708e0d760841c77c139.tar.bz2
dokka-1618e552c136e25d86bf0708e0d760841c77c139.zip
Versioning (#1654)
* Adding versioning mechanism for multimodule * Versioning improvement * Refactor configuration, add ordering * Fix integration tests * Change packages, unignore test Co-authored-by: Marcin Aman <marcin.aman@gmail.com>
Diffstat (limited to 'plugins/all-modules-page/src/main/kotlin/MultimodulePageCreator.kt')
-rw-r--r--plugins/all-modules-page/src/main/kotlin/MultimodulePageCreator.kt10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/all-modules-page/src/main/kotlin/MultimodulePageCreator.kt b/plugins/all-modules-page/src/main/kotlin/MultimodulePageCreator.kt
index a333d7c4..458cf4c1 100644
--- a/plugins/all-modules-page/src/main/kotlin/MultimodulePageCreator.kt
+++ b/plugins/all-modules-page/src/main/kotlin/MultimodulePageCreator.kt
@@ -8,6 +8,7 @@ import org.jetbrains.dokka.base.parsers.moduleAndPackage.ModuleAndPackageDocumen
import org.jetbrains.dokka.base.parsers.moduleAndPackage.parseModuleAndPackageDocumentation
import org.jetbrains.dokka.base.parsers.moduleAndPackage.parseModuleAndPackageDocumentationFragments
import org.jetbrains.dokka.base.resolvers.anchors.SymbolAnchorHint
+import org.jetbrains.dokka.base.templating.InsertTemplateExtra
import org.jetbrains.dokka.base.transformers.pages.comments.DocTagToContentConverter
import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder
import org.jetbrains.dokka.links.DRI
@@ -17,10 +18,14 @@ import org.jetbrains.dokka.model.doc.P
import org.jetbrains.dokka.model.properties.PropertyContainer
import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.plugability.DokkaContext
+import org.jetbrains.dokka.plugability.configuration
import org.jetbrains.dokka.plugability.plugin
import org.jetbrains.dokka.plugability.querySingle
import org.jetbrains.dokka.transformers.pages.PageCreator
import org.jetbrains.dokka.utilities.DokkaLogger
+import org.jetbrains.dokka.versioning.ReplaceVersionsCommand
+import org.jetbrains.dokka.versioning.VersioningConfiguration
+import org.jetbrains.dokka.versioning.VersioningPlugin
class MultimodulePageCreator(
private val context: DokkaContext,
@@ -39,6 +44,11 @@ class MultimodulePageCreator(
kind = ContentKind.Cover,
sourceSets = sourceSetData
) {
+ /* The line below checks if there is a provided configuration for versioning.
+ If not, we are skipping the template for inserting versions navigation */
+ configuration<VersioningPlugin, VersioningConfiguration>(context)?.let {
+ group(extra = PropertyContainer.withAll(InsertTemplateExtra(ReplaceVersionsCommand))) { }
+ }
header(2, "All modules:")
table(styles = setOf(MultimoduleTable)) {
modules.forEach { module ->