diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-05-20 12:05:26 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-06-15 13:15:30 +0200 |
commit | f3baf10b4c882230d382bfcdd94163d070bd0e25 (patch) | |
tree | 128b63b10f05242cfce88da6714d9e04987b5651 /plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | |
parent | 645e02fb42bbf1cd3ee2773a014ea1e553e09229 (diff) | |
download | dokka-f3baf10b4c882230d382bfcdd94163d070bd0e25.tar.gz dokka-f3baf10b4c882230d382bfcdd94163d070bd0e25.tar.bz2 dokka-f3baf10b4c882230d382bfcdd94163d070bd0e25.zip |
Rework dokka configuration and Gradle plugin
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt')
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 42273d20..528b7d16 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -22,7 +22,7 @@ open class HtmlRenderer( private val sourceSetDependencyMap = with(context.sourceSetCache) { allSourceSets.map { sourceSet -> - sourceSet to allSourceSets.filter { sourceSet.dependentSourceSets.contains(it.sourceSetName) } + sourceSet to allSourceSets.filter { sourceSet.dependentSourceSets.contains(it.sourceSetID ) } }.toMap() } @@ -93,14 +93,14 @@ open class HtmlRenderer( group.sourceSets.forEach { button(classes = "platform-tag platform-selector") { attributes["data-active"] = "" - attributes["data-filter"] = it.sourceSetName - when (it.platform.key) { + attributes["data-filter"] = it.sourceSetID + when(it.platform.key) { "common" -> classes = classes + "common-like" "native" -> classes = classes + "native-like" "jvm" -> classes = classes + "jvm-like" "js" -> classes = classes + "js-like" } - text(it.sourceSetName) + text(it.displayName) } } } @@ -161,10 +161,10 @@ open class HtmlRenderer( attributes["data-toggle-list"] = "data-toggle-list" contents.forEachIndexed { index, pair -> button(classes = "platform-bookmark") { - attributes["data-filterable-current"] = pair.first.sourceSetName - attributes["data-filterable-set"] = pair.first.sourceSetName + attributes["data-filterable-current"] = pair.first.sourceSetID + attributes["data-filterable-set"] = pair.first.sourceSetID if (index == 0) attributes["data-active"] = "" - attributes["data-toggle"] = pair.first.sourceSetName + attributes["data-toggle"] = pair.first.sourceSetID when ( pair.first.platform.key ) { @@ -173,8 +173,8 @@ open class HtmlRenderer( "jvm" -> classes = classes + "jvm-like" "js" -> classes = classes + "js-like" } - attributes["data-toggle"] = pair.first.sourceSetName - text(pair.first.sourceSetName) + attributes["data-toggle"] = pair.first.sourceSetID + text(pair.first.displayName) } } } @@ -242,10 +242,10 @@ open class HtmlRenderer( consumer.onTagContentUnsafe { +createHTML().div("divergent-group") { attributes["data-filterable-current"] = groupedDivergent.keys.joinToString(" ") { - it.sourceSetName + it.sourceSetID } attributes["data-filterable-set"] = groupedDivergent.keys.joinToString(" ") { - it.sourceSetName + it.sourceSetID } val divergentForPlatformDependent = groupedDivergent.map { (sourceSet, elements) -> @@ -346,12 +346,13 @@ open class HtmlRenderer( div(classes = "table-row") { if (!style.contains(MultimoduleTable)) { attributes["data-filterable-current"] = node.sourceSets.joinToString(" ") { - it.sourceSetName + it.sourceSetID } attributes["data-filterable-set"] = node.sourceSets.joinToString(" ") { - it.sourceSetName + it.sourceSetID } } + it.filterIsInstance<ContentLink>().takeIf { it.isNotEmpty() }?.let { div("main-subrow " + node.style.joinToString(" ")) { it.filter { sourceSetRestriction == null || it.sourceSets.any { s -> s in sourceSetRestriction } } @@ -396,7 +397,7 @@ open class HtmlRenderer( "jvm" -> classes = classes + "jvm-like" "js" -> classes = classes + "js-like" } - text(it.sourceSetName) + text(it.displayName) } } } |