aboutsummaryrefslogtreecommitdiff
path: root/plugins/gfm/src/main
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-05-05 11:53:16 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-05-19 09:56:32 +0200
commit430d7d6453a0b63dcabecd54aea915410cd35103 (patch)
treeb9e40e3eaa9f1948590141d7d46491e2f34f2ef9 /plugins/gfm/src/main
parentc1b4669ee227a479516f37ce1b9dff5f2d2bef38 (diff)
downloaddokka-430d7d6453a0b63dcabecd54aea915410cd35103.tar.gz
dokka-430d7d6453a0b63dcabecd54aea915410cd35103.tar.bz2
dokka-430d7d6453a0b63dcabecd54aea915410cd35103.zip
Add a draft version of divergent rendering
Diffstat (limited to 'plugins/gfm/src/main')
-rw-r--r--plugins/gfm/src/main/kotlin/GfmPlugin.kt16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/gfm/src/main/kotlin/GfmPlugin.kt b/plugins/gfm/src/main/kotlin/GfmPlugin.kt
index b7e9f6ab..fead66f1 100644
--- a/plugins/gfm/src/main/kotlin/GfmPlugin.kt
+++ b/plugins/gfm/src/main/kotlin/GfmPlugin.kt
@@ -63,7 +63,11 @@ open class CommonmarkRenderer(
append("]($address)")
}
- override fun StringBuilder.buildList(node: ContentList, pageContext: ContentPage, platformRestriction: SourceSetData?) {
+ override fun StringBuilder.buildList(
+ node: ContentList,
+ pageContext: ContentPage,
+ platformRestriction: Set<SourceSetData>?
+ ) {
buildParagraph()
buildListLevel(node, pageContext)
buildParagraph()
@@ -92,7 +96,7 @@ open class CommonmarkRenderer(
node.children,
pageContext,
"${node.extra.allOfType<SimpleAttr>().find { it.extraKey == "start" }?.extraValue
- ?: 1.also { context.logger.error("No starting number specified for ordered list in node ${pageContext.dri.first()}!")}}."
+ ?: 1.also { context.logger.error("No starting number specified for ordered list in node ${pageContext.dri.first()}!") }}."
)
} else {
buildListItem(node.children, pageContext, "*")
@@ -109,7 +113,7 @@ open class CommonmarkRenderer(
override fun StringBuilder.buildPlatformDependent(content: PlatformHintedContent, pageContext: ContentPage) {
val distinct = content.sourceSets.map {
- it to StringBuilder().apply {buildContentNode(content.inner, pageContext, it) }.toString()
+ it to StringBuilder().apply {buildContentNode(content.inner, pageContext, setOf(it)) }.toString()
}.groupBy(Pair<SourceSetData, String>::second, Pair<SourceSetData, String>::first)
if (distinct.size == 1)
@@ -124,7 +128,11 @@ open class CommonmarkRenderer(
append("Resource")
}
- override fun StringBuilder.buildTable(node: ContentTable, pageContext: ContentPage, platformRestriction: SourceSetData?) {
+ override fun StringBuilder.buildTable(
+ node: ContentTable,
+ pageContext: ContentPage,
+ platformRestriction: Set<SourceSetData>?
+ ) {
buildParagraph()
val size = node.children.firstOrNull()?.children?.size ?: 0