aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/templating
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/base/src/main/kotlin/templating
parentdc179bf9a649d925e7e64dbcaf52a2187416a1d5 (diff)
downloaddokka-d41965ca3cb180bc82bd5dd6fa747d2b83381b31.tar.gz
dokka-d41965ca3cb180bc82bd5dd6fa747d2b83381b31.tar.bz2
dokka-d41965ca3cb180bc82bd5dd6fa747d2b83381b31.zip
Implement immediate temaplates resolution
Diffstat (limited to 'plugins/base/src/main/kotlin/templating')
-rw-r--r--plugins/base/src/main/kotlin/templating/Command.kt6
-rw-r--r--plugins/base/src/main/kotlin/templating/ImmediateHtmlCommandConsumer.kt14
-rw-r--r--plugins/base/src/main/kotlin/templating/PathToRootSubstitutionCommand.kt2
3 files changed, 17 insertions, 5 deletions
diff --git a/plugins/base/src/main/kotlin/templating/Command.kt b/plugins/base/src/main/kotlin/templating/Command.kt
index 0b998dee..5a81144c 100644
--- a/plugins/base/src/main/kotlin/templating/Command.kt
+++ b/plugins/base/src/main/kotlin/templating/Command.kt
@@ -1,13 +1,11 @@
package org.jetbrains.dokka.base.templating
-import com.fasterxml.jackson.annotation.JsonSubTypes
-import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.JsonTypeInfo
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id.CLASS
-@JsonTypeInfo(use= CLASS)
+@JsonTypeInfo(use = CLASS)
interface Command
-abstract class SubstitutionCommand: Command {
+abstract class SubstitutionCommand : Command {
abstract val pattern: String
}
diff --git a/plugins/base/src/main/kotlin/templating/ImmediateHtmlCommandConsumer.kt b/plugins/base/src/main/kotlin/templating/ImmediateHtmlCommandConsumer.kt
new file mode 100644
index 00000000..a2a3b31e
--- /dev/null
+++ b/plugins/base/src/main/kotlin/templating/ImmediateHtmlCommandConsumer.kt
@@ -0,0 +1,14 @@
+package org.jetbrains.dokka.base.templating
+
+import org.jetbrains.dokka.base.renderers.html.TemplateBlock
+import org.jetbrains.dokka.base.renderers.html.command.consumers.ImmediateResolutionTagConsumer
+import org.jetbrains.dokka.plugability.DokkaContext
+
+interface ImmediateHtmlCommandConsumer {
+ fun canProcess(command:Command): Boolean
+
+ fun <R> processCommand(command: Command, block: TemplateBlock, tagConsumer: ImmediateResolutionTagConsumer<R>)
+
+ fun <R> processCommandAndFinalize(command: Command, block: TemplateBlock, tagConsumer: ImmediateResolutionTagConsumer<R>): R
+}
+
diff --git a/plugins/base/src/main/kotlin/templating/PathToRootSubstitutionCommand.kt b/plugins/base/src/main/kotlin/templating/PathToRootSubstitutionCommand.kt
index 03f091c3..f307db86 100644
--- a/plugins/base/src/main/kotlin/templating/PathToRootSubstitutionCommand.kt
+++ b/plugins/base/src/main/kotlin/templating/PathToRootSubstitutionCommand.kt
@@ -1,3 +1,3 @@
package org.jetbrains.dokka.base.templating
-data class PathToRootSubstitutionCommand(override val pattern: String): SubstitutionCommand() \ No newline at end of file
+data class PathToRootSubstitutionCommand(override val pattern: String, val default: String): SubstitutionCommand() \ No newline at end of file