diff options
Diffstat (limited to 'plugins/base')
5 files changed, 18 insertions, 23 deletions
diff --git a/plugins/base/api/base.api b/plugins/base/api/base.api index 5ba42101..f529b0ee 100644 --- a/plugins/base/api/base.api +++ b/plugins/base/api/base.api @@ -621,7 +621,7 @@ public final class org/jetbrains/dokka/base/renderers/html/command/consumers/Res public final class org/jetbrains/dokka/base/renderers/html/innerTemplating/DefaultTemplateModelFactory : org/jetbrains/dokka/base/renderers/html/innerTemplating/TemplateModelFactory { public fun <init> (Lorg/jetbrains/dokka/plugability/DokkaContext;)V - public fun buildModel (Lorg/jetbrains/dokka/pages/PageNode;Ljava/util/List;Lorg/jetbrains/dokka/base/resolvers/local/LocationProvider;ZLjava/lang/String;)Ljava/util/Map; + public fun buildModel (Lorg/jetbrains/dokka/pages/PageNode;Ljava/util/List;Lorg/jetbrains/dokka/base/resolvers/local/LocationProvider;Ljava/lang/String;)Ljava/util/Map; public fun buildSharedModel ()Ljava/util/Map; public final fun getContext ()Lorg/jetbrains/dokka/plugability/DokkaContext; } @@ -660,7 +660,7 @@ public final class org/jetbrains/dokka/base/renderers/html/innerTemplating/HtmlT } public abstract interface class org/jetbrains/dokka/base/renderers/html/innerTemplating/TemplateModelFactory { - public abstract fun buildModel (Lorg/jetbrains/dokka/pages/PageNode;Ljava/util/List;Lorg/jetbrains/dokka/base/resolvers/local/LocationProvider;ZLjava/lang/String;)Ljava/util/Map; + public abstract fun buildModel (Lorg/jetbrains/dokka/pages/PageNode;Ljava/util/List;Lorg/jetbrains/dokka/base/resolvers/local/LocationProvider;Ljava/lang/String;)Ljava/util/Map; public abstract fun buildSharedModel ()Ljava/util/Map; } diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 73fd07e0..b4d98b58 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -41,7 +41,7 @@ open class HtmlRenderer( setupSharedModel(templateModelMerger.invoke(templateModelFactories) { buildSharedModel() }) } - private var shouldRenderSourceSetBubbles: Boolean = false + private var shouldRenderSourceSetTabs: Boolean = false override val preprocessors = context.plugin<DokkaBase>().query { htmlPreprocessors } @@ -175,7 +175,7 @@ open class HtmlRenderer( pageContext: ContentPage, extra: PropertyContainer<ContentNode> = PropertyContainer.empty(), styles: Set<Style> = emptySet(), - shouldHaveTabs: Boolean = shouldRenderSourceSetBubbles + shouldHaveTabs: Boolean = shouldRenderSourceSetTabs ) { val contents = contentsForSourceSetDependent(nodes, pageContext) val isOnlyCommonContent = contents.singleOrNull()?.let { (sourceSet, _) -> @@ -500,19 +500,17 @@ open class HtmlRenderer( } private fun FlowContent.createPlatformTagBubbles(sourceSets: List<DisplaySourceSet>, cssClasses: String = "") { - if (shouldRenderSourceSetBubbles) { - div("platform-tags $cssClasses") { - sourceSets.sortedBy { it.name }.forEach { - div("platform-tag") { - when (it.platform.key) { - "common" -> classes = classes + "common-like" - "native" -> classes = classes + "native-like" - "jvm" -> classes = classes + "jvm-like" - "js" -> classes = classes + "js-like" - "wasm" -> classes = classes + "wasm-like" - } - text(it.name) + div("platform-tags $cssClasses") { + sourceSets.sortedBy { it.name }.forEach { + div("platform-tag") { + when (it.platform.key) { + "common" -> classes = classes + "common-like" + "native" -> classes = classes + "native-like" + "jvm" -> classes = classes + "jvm-like" + "js" -> classes = classes + "js-like" + "wasm" -> classes = classes + "wasm-like" } + text(it.name) } } } @@ -779,7 +777,7 @@ open class HtmlRenderer( } override fun render(root: RootPageNode) { - shouldRenderSourceSetBubbles = shouldRenderSourceSetBubbles(root) + shouldRenderSourceSetTabs = shouldRenderSourceSetTabs(root) super.render(root) } @@ -805,7 +803,6 @@ open class HtmlRenderer( page, resources, locationProvider, - shouldRenderSourceSetBubbles, generatedContent ) } diff --git a/plugins/base/src/main/kotlin/renderers/html/innerTemplating/DefaultTemplateModelFactory.kt b/plugins/base/src/main/kotlin/renderers/html/innerTemplating/DefaultTemplateModelFactory.kt index 6c746b37..3437271a 100644 --- a/plugins/base/src/main/kotlin/renderers/html/innerTemplating/DefaultTemplateModelFactory.kt +++ b/plugins/base/src/main/kotlin/renderers/html/innerTemplating/DefaultTemplateModelFactory.kt @@ -40,7 +40,6 @@ class DefaultTemplateModelFactory(val context: DokkaContext) : TemplateModelFact page: PageNode, resources: List<String>, locationProvider: LocationProvider, - shouldRenderSourceSetBubbles: Boolean, content: String ): TemplateMap { val path = locationProvider.resolve(page) @@ -66,7 +65,7 @@ class DefaultTemplateModelFactory(val context: DokkaContext) : TemplateModelFact } mapper["template_cmd"] = TemplateDirective(context.configuration, pathToRoot) - if (shouldRenderSourceSetBubbles && page is ContentPage) { + if (page is ContentPage) { val sourceSets = page.content.withDescendants() .flatMap { it.sourceSets } .distinct() diff --git a/plugins/base/src/main/kotlin/renderers/html/innerTemplating/TemplateModelFactory.kt b/plugins/base/src/main/kotlin/renderers/html/innerTemplating/TemplateModelFactory.kt index ceecf201..0d4c957e 100644 --- a/plugins/base/src/main/kotlin/renderers/html/innerTemplating/TemplateModelFactory.kt +++ b/plugins/base/src/main/kotlin/renderers/html/innerTemplating/TemplateModelFactory.kt @@ -8,9 +8,8 @@ interface TemplateModelFactory { page: PageNode, resources: List<String>, locationProvider: LocationProvider, - shouldRenderSourceSetBubbles: Boolean, content: String ): TemplateMap fun buildSharedModel(): TemplateMap -}
\ No newline at end of file +} diff --git a/plugins/base/src/main/kotlin/renderers/html/shouldRenderSourceSetBubbles.kt b/plugins/base/src/main/kotlin/renderers/html/shouldRenderSourceSetBubbles.kt index 3de58870..ce9dd1b7 100644 --- a/plugins/base/src/main/kotlin/renderers/html/shouldRenderSourceSetBubbles.kt +++ b/plugins/base/src/main/kotlin/renderers/html/shouldRenderSourceSetBubbles.kt @@ -4,7 +4,7 @@ import org.jetbrains.dokka.model.withDescendants import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.RootPageNode -internal fun shouldRenderSourceSetBubbles(page: RootPageNode): Boolean { +internal fun shouldRenderSourceSetTabs(page: RootPageNode): Boolean { return page.withDescendants() .flatMap { pageNode -> if (pageNode is ContentPage) pageNode.content.withDescendants() |