aboutsummaryrefslogtreecommitdiff
path: root/plugins/gfm/src/main/kotlin
diff options
context:
space:
mode:
authorMike Sinkovsky <msink@users.noreply.github.com>2021-07-19 17:56:23 +0500
committerGitHub <noreply@github.com>2021-07-19 14:56:23 +0200
commit01ce00036a403c1d6bba3cb1b4c228f2df3f8b6c (patch)
tree12cf05dac9a1a3b5809728c695c14b8bd64b405b /plugins/gfm/src/main/kotlin
parent772f0c6093bb68a776ce253025a96abc2c9667ed (diff)
downloaddokka-01ce00036a403c1d6bba3cb1b4c228f2df3f8b6c.tar.gz
dokka-01ce00036a403c1d6bba3cb1b4c228f2df3f8b6c.tar.bz2
dokka-01ce00036a403c1d6bba3cb1b4c228f2df3f8b6c.zip
Minor: rename `buildNewLine` (#1987)
* minor: rename `DefaultRenderer.buildNewLine` to `buildLineBreak` to better describe what it actually does. * minor: rename `CommonmarRenderer.appendNewLine` to `buildNewLine` for consistency.
Diffstat (limited to 'plugins/gfm/src/main/kotlin')
-rw-r--r--plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt28
1 files changed, 14 insertions, 14 deletions
diff --git a/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt b/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt
index 36e461a9..e940fffd 100644
--- a/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt
+++ b/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt
@@ -98,18 +98,18 @@ open class CommonmarkRenderer(
} else buildText(node.children, pageContext, sourceSetRestriction)
}
- override fun StringBuilder.buildNewLine() {
+ override fun StringBuilder.buildLineBreak() {
append("\\")
- appendNewLine()
+ buildNewLine()
}
- private fun StringBuilder.appendNewLine() {
+ private fun StringBuilder.buildNewLine() {
append("\n")
}
private fun StringBuilder.buildParagraph() {
- appendNewLine()
- appendNewLine()
+ buildNewLine()
+ buildNewLine()
}
override fun StringBuilder.buildPlatformDependent(
@@ -135,7 +135,7 @@ open class CommonmarkRenderer(
distinct.filter { it.key.isNotBlank() }.forEach { (text, platforms) ->
buildParagraph()
buildSourceSetTags(platforms.toSet())
- buildNewLine()
+ buildLineBreak()
append(text.trim())
buildParagraph()
}
@@ -154,18 +154,18 @@ open class CommonmarkRenderer(
pageContext: ContentPage,
sourceSetRestriction: Set<DisplaySourceSet>?
) {
- appendNewLine()
+ buildNewLine()
if (node.dci.kind == ContentKind.Sample || node.dci.kind == ContentKind.Parameters) {
node.sourceSets.forEach { sourcesetData ->
append(sourcesetData.name)
- appendNewLine()
+ buildNewLine()
buildTable(
node.copy(
children = node.children.filter { it.sourceSets.contains(sourcesetData) },
dci = node.dci.copy(kind = ContentKind.Main)
), pageContext, sourceSetRestriction
)
- appendNewLine()
+ buildNewLine()
}
} else {
val size = node.header.firstOrNull()?.children?.size ?: node.children.firstOrNull()?.children?.size ?: 0
@@ -183,11 +183,11 @@ open class CommonmarkRenderer(
append("| ".repeat(size))
}
append("|")
- appendNewLine()
+ buildNewLine()
append("|---".repeat(size))
append("|")
- appendNewLine()
+ buildNewLine()
node.children.forEach { row ->
row.children.forEach { cell ->
@@ -202,7 +202,7 @@ open class CommonmarkRenderer(
append(" ")
}
append("|")
- appendNewLine()
+ buildNewLine()
}
}
}
@@ -256,7 +256,7 @@ open class CommonmarkRenderer(
buildParagraph()
buildSourceSetTags(sourceSets)
- buildNewLine()
+ buildLineBreak()
instance.before?.let {
buildContentNode(
@@ -272,7 +272,7 @@ open class CommonmarkRenderer(
val (innerInstance, innerSourceSets) = innerEntry.getInstanceAndSourceSets()
if (sourceSets.size > 1) {
buildSourceSetTags(innerSourceSets)
- buildNewLine()
+ buildLineBreak()
}
innerInstance.divergent.build(
this@buildDivergent,