aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-10-03 04:16:47 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-10-03 04:16:47 +0300
commitbe3e435500246b971ac12ffccad9d11417f4717c (patch)
treeef29e56d20ab940aca0a2a424c3c77498e40cadc
parent5719e5c5f7d90aa606421381a0e4e4ffbf1b9066 (diff)
downloaddokka-be3e435500246b971ac12ffccad9d11417f4717c.tar.gz
dokka-be3e435500246b971ac12ffccad9d11417f4717c.tar.bz2
dokka-be3e435500246b971ac12ffccad9d11417f4717c.zip
Wrap node's own description on full page into block
-rw-r--r--core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt7
-rw-r--r--core/src/main/kotlin/Formats/StructuredFormatService.kt27
2 files changed, 25 insertions, 9 deletions
diff --git a/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt b/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt
index 9ffefcab..c412b34e 100644
--- a/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt
+++ b/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt
@@ -168,6 +168,13 @@ open class KotlinWebsiteHtmlOutputBuilder(
}
}
+ override fun appendAsNodeDescription(platforms: Set<String>, block: () -> Unit) {
+ div(to, "node-page-main", otherAttributes = " ${calculateDataAttributes(platforms)}") {
+ block()
+ }
+
+ }
+
override fun appendBreadcrumbSeparator() {
to.append(" / ")
}
diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt
index 4496d652..67a2f293 100644
--- a/core/src/main/kotlin/Formats/StructuredFormatService.kt
+++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt
@@ -145,6 +145,10 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
appendText(text)
}
+ open fun appendAsNodeDescription(platforms: Set<String>, block: () -> Unit) {
+ block()
+ }
+
fun appendEntity(text: String) {
to.append(text)
}
@@ -361,7 +365,10 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
}
if (breakdownBySummary.size == 1) {
- formatOverloadGroup(breakdownBySummary.values.single(), isSingleNode)
+ val node = breakdownBySummary.values.single()
+ appendAsNodeDescription(effectivePlatformAndVersion(node)) {
+ formatOverloadGroup(node, isSingleNode)
+ }
} else {
for ((_, items) in breakdownBySummary) {
appendAsOverloadGroup(to, effectivePlatformAndVersion(items)) {
@@ -622,16 +629,18 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
appendLine()
appendHeader { appendText(node.name) }
- renderGroupNode(node, true)
+ appendAsNodeDescription(effectivePlatformAndVersion(node)) {
+ renderGroupNode(node, true)
- val groupByContent = node.origins.groupBy { it.content }
- for ((content, origins) in groupByContent) {
- if (content.isEmpty()) continue
- appendAsPlatformDependentBlock(effectivePlatformsForMembers(origins)) { platforms ->
- if (groupByContent.keys.count { !it.isEmpty() } > 1) {
- appendPlatformsAsText(platforms)
+ val groupByContent = node.origins.groupBy { it.content }
+ for ((content, origins) in groupByContent) {
+ if (content.isEmpty()) continue
+ appendAsPlatformDependentBlock(effectivePlatformsForMembers(origins)) { platforms ->
+ if (groupByContent.keys.count { !it.isEmpty() } > 1) {
+ appendPlatformsAsText(platforms)
+ }
+ appendContent(content)
}
- appendContent(content)
}
}