aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/renderers
diff options
context:
space:
mode:
authorMarcin Aman <maman@virtuslab.com>2020-06-03 09:30:28 +0200
committerPaweł Marks <pmarks@virtuslab.com>2020-06-12 14:15:24 +0200
commit3ca8ca75c60892de68f4fe18335aa79f4622c93c (patch)
tree19b4a936a602edfaf6eec8ec0882285e2af403fb /plugins/base/src/main/kotlin/renderers
parentdd44b839eac1b7b647e97f2cc73dd96bd054713b (diff)
downloaddokka-3ca8ca75c60892de68f4fe18335aa79f4622c93c.tar.gz
dokka-3ca8ca75c60892de68f4fe18335aa79f4622c93c.tar.bz2
dokka-3ca8ca75c60892de68f4fe18335aa79f4622c93c.zip
Stdlib wrapping in signature
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers')
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt9
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/Tags.kt12
2 files changed, 21 insertions, 0 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
index 67fa2d91..42273d20 100644
--- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
@@ -67,6 +67,15 @@ open class HtmlRenderer(
childrenCallback()
if (node.hasStyle(TextStyle.Monospace)) copyButton()
}
+ node.hasStyle(TextStyle.BreakableAfter) -> {
+ span(){ childrenCallback() }
+ wbr { }
+ }
+ node.hasStyle(TextStyle.Breakable) -> {
+ span("breakable-word"){ childrenCallback() }
+ }
+ node.hasStyle(TextStyle.Span) -> span(){ childrenCallback() }
+ node.dci.kind == ContentKind.Symbol -> div("symbol $additionalClasses") { childrenCallback() }
node.dci.kind == ContentKind.BriefComment -> div("brief $additionalClasses") { childrenCallback() }
node.dci.kind == ContentKind.Cover -> div("cover $additionalClasses") {
filterButtons(node)
diff --git a/plugins/base/src/main/kotlin/renderers/html/Tags.kt b/plugins/base/src/main/kotlin/renderers/html/Tags.kt
new file mode 100644
index 00000000..a3951eff
--- /dev/null
+++ b/plugins/base/src/main/kotlin/renderers/html/Tags.kt
@@ -0,0 +1,12 @@
+package org.jetbrains.dokka.base.renderers.html
+
+import kotlinx.html.*
+
+@HtmlTagMarker
+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 {
+
+} \ No newline at end of file