aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/renderers
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-05-20 12:05:26 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-06-15 13:15:30 +0200
commitf3baf10b4c882230d382bfcdd94163d070bd0e25 (patch)
tree128b63b10f05242cfce88da6714d9e04987b5651 /plugins/base/src/main/kotlin/renderers
parent645e02fb42bbf1cd3ee2773a014ea1e553e09229 (diff)
downloaddokka-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')
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt29
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt2
2 files changed, 16 insertions, 15 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)
}
}
}
diff --git a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt
index f10c85d5..cdb30555 100644
--- a/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/htmlPreprocessors.kt
@@ -87,7 +87,7 @@ object StyleAndScriptsAppender : PageTransformer {
class SourcesetDependencyAppender(val context: DokkaContext) : PageTransformer{
override fun invoke(input: RootPageNode): RootPageNode {
val dependenciesMap = context.configuration.passesConfigurations.map {
- it.sourceSetName to it.dependentSourceSets
+ it.sourceSetID to it.dependentSourceSets
}.toMap()
fun createDependenciesJson() : String = "sourceset_dependencies = '{${
dependenciesMap.entries.joinToString(", ") {