diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2018-10-03 03:59:57 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2018-10-03 03:59:57 +0300 |
commit | 896776306e15f1e5bbdc771a3e58d0ffd8b45198 (patch) | |
tree | c13f252c9f047314d7d1afd1dccfc2d5f62a5265 | |
parent | 2f377659e7b5251dceb4df3a6a25fe922edf28c6 (diff) | |
download | dokka-896776306e15f1e5bbdc771a3e58d0ffd8b45198.tar.gz dokka-896776306e15f1e5bbdc771a3e58d0ffd8b45198.tar.bz2 dokka-896776306e15f1e5bbdc771a3e58d0ffd8b45198.zip |
Introduce block for grouped by summary items
-rw-r--r-- | core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt | 6 | ||||
-rw-r--r-- | core/src/main/kotlin/Formats/StructuredFormatService.kt | 21 |
2 files changed, 18 insertions, 9 deletions
diff --git a/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt b/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt index 220f2f4d..65c93e72 100644 --- a/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt +++ b/core/src/main/kotlin/Formats/KotlinWebsiteHtmlFormatService.kt @@ -206,6 +206,12 @@ open class KotlinWebsiteHtmlOutputBuilder( else block(platforms) } + + override fun appendAsSummaryGroup(platforms: Set<String>, block: (Set<String>) -> Unit) { + div(to, "summary-group", otherAttributes = " ${calculateDataAttributes(platforms)}") { + block(platforms) + } + } } class KotlinWebsiteHtmlFormatService @Inject constructor( diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index 764fd50e..647f2dfb 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -129,6 +129,10 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, block(platforms) } + open fun appendAsSummaryGroup(platforms: Set<String>, block: (Set<String>) -> Unit) { + appendAsPlatformDependentBlock(platforms, block) + } + open fun appendSymbol(text: String) { appendText(text) } @@ -787,21 +791,20 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, ) { for(summary in summarized.data) { - - - appendAsPlatformDependentBlock(summary.platforms) { + appendAsSummaryGroup(summary.platforms) { if (summarized.platformPlacement == Summarized.PlatformPlacement.Summary) { appendPlatforms(summary.platforms) } appendContent(summary.content) appendSoftLineBreak() + for (signature in summary.signatures) { + appendSignatures( + signature, + summarized.platformPlacement == Summarized.PlatformPlacement.Signature + ) + } } - for (signature in summary.signatures) { - appendSignatures( - signature, - summarized.platformPlacement == Summarized.PlatformPlacement.Signature - ) - } + } } |