diff options
author | vmishenev <vad-mishenev@yandex.ru> | 2021-10-15 12:38:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-15 12:38:18 +0300 |
commit | dc54ebd087124ee9035585ac64fa85c9b8957081 (patch) | |
tree | 9a87b8c85facd65824f12b23b53abef5db2ccce3 /plugins/base/src/main/kotlin | |
parent | b2663070490d6ad31a0e7ba7ae80d16dbde43aef (diff) | |
download | dokka-dc54ebd087124ee9035585ac64fa85c9b8957081.tar.gz dokka-dc54ebd087124ee9035585ac64fa85c9b8957081.tar.bz2 dokka-dc54ebd087124ee9035585ac64fa85c9b8957081.zip |
Fix missed multiplatform tabs (#2178)
Diffstat (limited to 'plugins/base/src/main/kotlin')
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 9a88de86..26560e4f 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -211,29 +211,20 @@ open class HtmlRenderer( ): List<Pair<DisplaySourceSet, String>> { var counter = 0 return nodes.toList().map { (sourceSet, elements) -> - sourceSet to createHTML(prettyPrint = false).prepareForTemplates().div { + val htmlContent = createHTML(prettyPrint = false).prepareForTemplates().div { elements.forEach { buildContentNode(it, pageContext, sourceSet.toSet()) } }.stripDiv() - }.groupBy( - Pair<DisplaySourceSet, String>::second, - Pair<DisplaySourceSet, String>::first - ).entries.flatMap { (html, sourceSets) -> - sourceSets.filterNot { sourceSet -> - sourceSet.sourceSetIDs.all.flatMap { sourceSetDependencyMap[it].orEmpty() } - .any { sourceSetId -> sourceSetId in sourceSets.sourceSetIDs } - }.map { - it to createHTML(prettyPrint = false).prepareForTemplates() - .div(classes = "content sourceset-depenent-content") { - if (counter++ == 0) attributes["data-active"] = "" - attributes["data-togglable"] = it.sourceSetIDs.merged.toString() - unsafe { - +html - } + sourceSet to createHTML(prettyPrint = false).prepareForTemplates() + .div(classes = "content sourceset-depenent-content") { + if (counter++ == 0) attributes["data-active"] = "" + attributes["data-togglable"] = sourceSet.sourceSetIDs.merged.toString() + unsafe { + +htmlContent } - } - } + } + }.sortedBy { it.first.sourceSetIDs.merged.let { it.scopeId + it.sourceSetName } } } override fun FlowContent.buildDivergent(node: ContentDivergentGroup, pageContext: ContentPage) { |