aboutsummaryrefslogtreecommitdiff
path: root/plugins/templating/src/main/kotlin/templates/ReplaceVersionCommandHandler.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/templating/src/main/kotlin/templates/ReplaceVersionCommandHandler.kt')
-rw-r--r--plugins/templating/src/main/kotlin/templates/ReplaceVersionCommandHandler.kt31
1 files changed, 0 insertions, 31 deletions
diff --git a/plugins/templating/src/main/kotlin/templates/ReplaceVersionCommandHandler.kt b/plugins/templating/src/main/kotlin/templates/ReplaceVersionCommandHandler.kt
deleted file mode 100644
index 28820278..00000000
--- a/plugins/templating/src/main/kotlin/templates/ReplaceVersionCommandHandler.kt
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
- */
-
-package templates
-
-import org.jetbrains.dokka.base.templating.Command
-import org.jetbrains.dokka.base.templating.ReplaceVersionsCommand
-import org.jetbrains.dokka.plugability.DokkaContext
-import org.jetbrains.dokka.templates.CommandHandler
-import org.jsoup.nodes.Element
-import org.jsoup.nodes.TextNode
-import java.io.File
-
-public class ReplaceVersionCommandHandler(
- private val context: DokkaContext
-) : CommandHandler {
-
- override fun canHandle(command: Command): Boolean = command is ReplaceVersionsCommand
-
- override fun handleCommandAsTag(command: Command, body: Element, input: File, output: File) {
- val parent = body.parent()
- if (parent != null) {
- val position = body.elementSiblingIndex()
- body.remove()
-
- context.configuration.moduleVersion?.takeIf { it.isNotEmpty() }
- ?.let { parent.insertChildren(position, TextNode(it)) }
- }
- }
-}