aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/renderers/html
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers/html')
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt4
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/Tags.kt17
2 files changed, 15 insertions, 6 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
index 9fbecad3..661e1e58 100644
--- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
@@ -13,6 +13,7 @@ import org.jetbrains.dokka.base.renderers.isImage
import org.jetbrains.dokka.base.renderers.pageId
import org.jetbrains.dokka.base.resolvers.anchors.SymbolAnchorHint
import org.jetbrains.dokka.base.resolvers.local.DokkaBaseLocationProvider
+import org.jetbrains.dokka.base.templating.ResolveLinkCommand
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.DisplaySourceSet
import org.jetbrains.dokka.model.properties.PropertyContainer
@@ -657,8 +658,7 @@ open class HtmlRenderer(
buildLink(address) {
buildText(node.children, pageContext, sourceSetRestriction)
}
- } ?: span {
- attributes["data-unresolved-link"] = node.address.toString().htmlEscape()
+ } ?: templateCommand(ResolveLinkCommand(node.address)) {
buildText(node.children, pageContext, sourceSetRestriction)
}
diff --git a/plugins/base/src/main/kotlin/renderers/html/Tags.kt b/plugins/base/src/main/kotlin/renderers/html/Tags.kt
index a3951eff..67eed686 100644
--- a/plugins/base/src/main/kotlin/renderers/html/Tags.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/Tags.kt
@@ -1,12 +1,21 @@
package org.jetbrains.dokka.base.renderers.html
import kotlinx.html.*
+import org.jetbrains.dokka.base.templating.Command
+import org.jetbrains.dokka.base.templating.toJsonString
@HtmlTagMarker
-fun FlowOrPhrasingContent.wbr(classes : String? = null, block : WBR.() -> Unit = {}) : Unit = WBR(attributesMapOf("class", classes), consumer).visit(block)
+fun FlowOrPhrasingContent.wbr(classes: String? = null, block: WBR.() -> Unit = {}): Unit =
+ WBR(attributesMapOf("class", classes), consumer).visit(block)
@Suppress("unused")
-open class WBR(initialAttributes : Map<String, String>, override val consumer : TagConsumer<*>) : HTMLTag("wbr", consumer, initialAttributes, null, true, false),
- HtmlBlockInlineTag {
+open class WBR(initialAttributes: Map<String, String>, consumer: TagConsumer<*>) :
+ HTMLTag("wbr", consumer, initialAttributes, namespace = null, inlineTag = true, emptyTag = false),
+ HtmlBlockInlineTag
-} \ No newline at end of file
+fun FlowOrPhrasingContent.templateCommand(data: Command, block: TemplateCommand.() -> Unit = {}):Unit =
+ TemplateCommand(attributesMapOf("data", toJsonString(data)), consumer).visit(block)
+
+class TemplateCommand(initialAttributes: Map<String, String>, consumer: TagConsumer<*>) :
+ HTMLTag("dokka-template-command", consumer, initialAttributes, namespace = null, inlineTag = true, emptyTag = false),
+ CommonAttributeGroupFacadeFlowInteractivePhrasingContent