diff options
Diffstat (limited to 'plugins/base')
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 388ee72f..85005bc0 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -81,6 +81,15 @@ open class HtmlRenderer( button(classes = "platform-bookmark") { if (index == 0) attributes["data-active"] = "" attributes["data-toggle"] = pair.first.sourceSetName + when( + pair.first.platform.key + ){ + "common" -> classes = classes + "common-like" + "native" -> classes = classes + "native-like" + "jvm" -> classes = classes + "jvm-like" + "js" -> classes = classes + "js-like" + } + attributes["data-toggle"] = pair.first.sourceSetName text(pair.first.sourceSetName) } } @@ -230,14 +239,18 @@ open class HtmlRenderer( } } - private fun FlowContent.createPlatformTags(node: ContentNode, sourceSetRestriction: Set<SourceSetData>? = null) { node.takeIf { sourceSetRestriction == null || it.sourceSets.any { s -> s in sourceSetRestriction } }?.let { div("platform-tags") { - node.sourceSets.filter { sourceSetRestriction == null || it in sourceSetRestriction }.forEach { + node.sourceSets.filter { sourceSetRestriction == null || it in sourceSetRestriction }.forEach { data -> div("platform-tag") { - if (it.sourceSetName.equals("common", ignoreCase = true)) classes = classes + "common" - text(it.sourceSetName) + when(data.platform.key){ + "common" -> classes = classes + "common-like" + "native" -> classes = classes + "native-like" + "jvm" -> classes = classes + "jvm-like" + "js" -> classes = classes + "js-like" + } + text(data.sourceSetName) } } } |