aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2022-09-02 17:44:05 +0200
committerGitHub <noreply@github.com>2022-09-02 17:44:05 +0200
commit56ff8f3f24209bc9edaece876c56bd3fde1fbf8a (patch)
tree82ec6b6d9295f09b96d37166d2423b036313d7a6 /plugins/base/src/main/kotlin
parent7aae28c09fc52f67d18babb0238dc8a4d397c2ad (diff)
downloaddokka-56ff8f3f24209bc9edaece876c56bd3fde1fbf8a.tar.gz
dokka-56ff8f3f24209bc9edaece876c56bd3fde1fbf8a.tar.bz2
dokka-56ff8f3f24209bc9edaece876c56bd3fde1fbf8a.zip
Underline `@param` tag key for more consistency (#2643)
* Underline `@param` tag key for more consistency * Correct keyValue table column ratio
Diffstat (limited to 'plugins/base/src/main/kotlin')
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt1
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/Tags.kt6
-rw-r--r--plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt1
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt2
-rw-r--r--plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt1
5 files changed, 10 insertions, 1 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
index f5c3854c..cb7f58d2 100644
--- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
@@ -791,6 +791,7 @@ open class HtmlRenderer(
TextStyle.Strikethrough -> strike { body() }
TextStyle.Strong -> strong { body() }
TextStyle.Var -> htmlVar { body() }
+ TextStyle.Underlined -> underline { body() }
is TokenStyle -> span("token " + styleToApply.toString().toLowerCase()) { body() }
else -> body()
}
diff --git a/plugins/base/src/main/kotlin/renderers/html/Tags.kt b/plugins/base/src/main/kotlin/renderers/html/Tags.kt
index ef27b934..18a321cc 100644
--- a/plugins/base/src/main/kotlin/renderers/html/Tags.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/Tags.kt
@@ -26,6 +26,12 @@ inline fun FlowOrPhrasingContent.strike(classes : String? = null, crossinline bl
open class STRIKE(initialAttributes: Map<String, String>, override val consumer: TagConsumer<*>) :
HTMLTag("strike", consumer, initialAttributes, null, false, false), HtmlBlockInlineTag
+@HtmlTagMarker
+inline fun FlowOrPhrasingContent.underline(classes : String? = null, crossinline block : UNDERLINE.() -> Unit = {}) : Unit = UNDERLINE(attributesMapOf("class", classes), consumer).visit(block)
+
+open class UNDERLINE(initialAttributes: Map<String, String>, override val consumer: TagConsumer<*>) :
+ HTMLTag("u", consumer, initialAttributes, null, false, false), HtmlBlockInlineTag
+
const val TEMPLATE_COMMAND_SEPARATOR = ":"
const val TEMPLATE_COMMAND_BEGIN_BORDER = "[+]cmd"
const val TEMPLATE_COMMAND_END_BORDER = "[-]cmd"
diff --git a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt
index 1c447e9e..2193283c 100644
--- a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt
+++ b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt
@@ -255,6 +255,7 @@ open class DocTagToContentConverter : CommentsToContentConverter {
)
)
is Var -> buildChildren(docTag, setOf(TextStyle.Var))
+ is U -> buildChildren(docTag, setOf(TextStyle.Underlined))
else -> buildChildren(docTag)
}
diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
index 7f16c568..12fbb33c 100644
--- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
+++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
@@ -572,7 +572,7 @@ open class DefaultPageCreator(
text(
it.name,
kind = ContentKind.Parameters,
- styles = mainStyles + ContentStyle.RowTitle
+ styles = mainStyles + setOf(ContentStyle.RowTitle, TextStyle.Underlined)
)
if (it.isNotEmpty()) {
comment(it.root)
diff --git a/plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt b/plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt
index 7dc8e3a0..076d43a2 100644
--- a/plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt
+++ b/plugins/base/src/main/kotlin/translators/psi/parsers/JavadocParser.kt
@@ -425,6 +425,7 @@ class JavadocParser(
"h2" -> ifChildrenPresent { H2(children) }
"h3" -> ifChildrenPresent { H3(children) }
"var" -> ifChildrenPresent { Var(children) }
+ "u" -> ifChildrenPresent { U(children) }
else -> listOf(Text(body = element.ownText()))
}
}