aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/renderers/html/shouldRenderSourceSetBubbles.kt
blob: ce9dd1b79c2668095736ec45783dfcb816335f2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package org.jetbrains.dokka.base.renderers.html

import org.jetbrains.dokka.model.withDescendants
import org.jetbrains.dokka.pages.ContentPage
import org.jetbrains.dokka.pages.RootPageNode

internal fun shouldRenderSourceSetTabs(page: RootPageNode): Boolean {
    return page.withDescendants()
        .flatMap { pageNode ->
            if (pageNode is ContentPage) pageNode.content.withDescendants()
            else emptySequence()
        }
        .flatMap { contentNode -> contentNode.sourceSets }
        .distinct()
        .count() > 1
}