From a440f0cb8756019131a2c15389e747aea3c585e7 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Wed, 13 May 2020 16:20:44 +0200 Subject: Platform dependant comments --- .../src/main/kotlin/renderers/html/HtmlRenderer.kt | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'plugins/base/src/main/kotlin/renderers/html') diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 4f0c1e55..c061cabf 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -128,22 +128,32 @@ open class HtmlRenderer( ?.let { div(classes = "table-row") { it.filter { it.dci.kind != ContentKind.Symbol }.takeIf { it.isNotEmpty() }?.let { - div("main-subrow") { + div("main-subrow ${node.style.joinToString { it.toString().decapitalize() }}") { it.filter { platformRestriction == null || platformRestriction in it.platforms } .forEach { when(it.dci.kind){ - ContentKind.Main -> div("title") { - it.build(this, pageContext, platformRestriction) + ContentKind.PlatformDependantHint -> { + div("platform-dependant-row keyValue"){ + div() + div("title"){ + it.build(this, pageContext, platformRestriction) + } + } } - ContentKind.BriefComment, ContentKind.Comment -> div("brief") { - it.build(this, pageContext, platformRestriction) + ContentKind.Main -> { + div("title-row"){ + it.build(this, pageContext, platformRestriction) + div() + if (ContentKind.shouldBePlatformTagged(node.dci.kind) && node.platforms.size == 1) { + createPlatformTags(node) + } else { + div() + } + } } else -> div { it.build(this, pageContext, platformRestriction) } } } - if (ContentKind.shouldBePlatformTagged(node.dci.kind) && node.platforms.size == 1) { - createPlatformTags(node) - } } } it.filter { it.dci.kind == ContentKind.Symbol }.takeIf { it.isNotEmpty() }?.let { -- cgit