From ef1bb10aca292e14d8deb35694243fd84fc75341 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Mon, 17 Aug 2020 10:49:41 +0200 Subject: Rename `ContentSourceSet` to `DisplaySourceSet` --- .../src/main/kotlin/renderers/DefaultRenderer.kt | 24 +++++------ .../src/main/kotlin/renderers/html/HtmlRenderer.kt | 48 +++++++++++----------- .../main/kotlin/renderers/html/NavigationPage.kt | 4 +- .../kotlin/resolvers/local/BaseLocationProvider.kt | 4 +- .../resolvers/local/DefaultLocationProvider.kt | 4 +- .../kotlin/resolvers/local/LocationProvider.kt | 4 +- .../resolvers/local/MultimoduleLocationProvider.kt | 4 +- .../pages/comments/DocTagToContentConverter.kt | 36 ++++++++-------- .../merger/SourceSetMergingPageTransformer.kt | 8 ++-- .../pages/samples/SamplesTransformer.kt | 5 +-- .../pages/sourcelinks/SourceLinksTransformer.kt | 4 +- .../documentables/DefaultPageCreator.kt | 2 +- .../documentables/PageContentBuilder.kt | 24 +++++------ 13 files changed, 85 insertions(+), 86 deletions(-) (limited to 'plugins/base') diff --git a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt index b7062310..ef04bb47 100644 --- a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt @@ -6,7 +6,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.resolvers.local.LocationProvider -import org.jetbrains.dokka.model.ContentSourceSet +import org.jetbrains.dokka.model.DisplaySourceSet import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin @@ -30,7 +30,7 @@ abstract class DefaultRenderer( abstract fun T.buildList( node: ContentList, pageContext: ContentPage, - sourceSetRestriction: Set? = null + sourceSetRestriction: Set? = null ) abstract fun T.buildNewLine() @@ -38,7 +38,7 @@ abstract class DefaultRenderer( abstract fun T.buildTable( node: ContentTable, pageContext: ContentPage, - sourceSetRestriction: Set? = null + sourceSetRestriction: Set? = null ) abstract fun T.buildText(textNode: ContentText) @@ -50,13 +50,13 @@ abstract class DefaultRenderer( open fun T.buildPlatformDependent( content: PlatformHintedContent, pageContext: ContentPage, - sourceSetRestriction: Set? + sourceSetRestriction: Set? ) = buildContentNode(content.inner, pageContext) open fun T.buildGroup( node: ContentGroup, pageContext: ContentPage, - sourceSetRestriction: Set? = null + sourceSetRestriction: Set? = null ) = wrapGroup(node, pageContext) { node.children.forEach { it.build(this, pageContext, sourceSetRestriction) } } @@ -69,7 +69,7 @@ abstract class DefaultRenderer( open fun T.buildLinkText( nodes: List, pageContext: ContentPage, - sourceSetRestriction: Set? = null + sourceSetRestriction: Set? = null ) { nodes.forEach { it.build(this, pageContext, sourceSetRestriction) } } @@ -85,7 +85,7 @@ abstract class DefaultRenderer( open fun T.buildHeader( node: ContentHeader, pageContext: ContentPage, - sourceSetRestriction: Set? = null + sourceSetRestriction: Set? = null ) { buildHeader(node.level, node) { node.children.forEach { it.build(this, pageContext, sourceSetRestriction) } } } @@ -93,14 +93,14 @@ abstract class DefaultRenderer( open fun ContentNode.build( builder: T, pageContext: ContentPage, - sourceSetRestriction: Set? = null + sourceSetRestriction: Set? = null ) = builder.buildContentNode(this, pageContext, sourceSetRestriction) open fun T.buildContentNode( node: ContentNode, pageContext: ContentPage, - sourceSetRestriction: Set? = null + sourceSetRestriction: Set? = null ) { if (sourceSetRestriction == null || node.sourceSets.any { it in sourceSetRestriction }) { when (node) { @@ -178,8 +178,8 @@ abstract class DefaultRenderer( protected fun ContentDivergentGroup.groupDivergentInstances( pageContext: ContentPage, - beforeTransformer: (ContentDivergentInstance, ContentPage, ContentSourceSet) -> String, - afterTransformer: (ContentDivergentInstance, ContentPage, ContentSourceSet) -> String + beforeTransformer: (ContentDivergentInstance, ContentPage, DisplaySourceSet) -> String, + afterTransformer: (ContentDivergentInstance, ContentPage, DisplaySourceSet) -> String ): Map> = children.flatMap { instance -> instance.sourceSets.map { sourceSet -> @@ -195,6 +195,6 @@ abstract class DefaultRenderer( } internal typealias SerializedBeforeAndAfter = Pair -internal typealias InstanceWithSource = Pair +internal typealias InstanceWithSource = Pair fun ContentPage.sourceSets() = this.content.sourceSets diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 529caa93..812776af 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -11,7 +11,7 @@ import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.DefaultRenderer import org.jetbrains.dokka.base.renderers.TabSortingStrategy import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.model.ContentSourceSet +import org.jetbrains.dokka.model.DisplaySourceSet import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.model.sourceSetIDs @@ -116,13 +116,13 @@ open class HtmlRenderer( button(classes = "platform-tag platform-selector") { attributes["data-active"] = "" attributes["data-filter"] = it.sourceSetIDs.merged.toString() - when (it.analysisPlatform.key) { + when (it.platform.key) { "common" -> classes = classes + "common-like" "native" -> classes = classes + "native-like" "jvm" -> classes = classes + "jvm-like" "js" -> classes = classes + "js-like" } - text(it.displayName) + text(it.name) } } } @@ -161,7 +161,7 @@ open class HtmlRenderer( override fun FlowContent.buildPlatformDependent( content: PlatformHintedContent, pageContext: ContentPage, - sourceSetRestriction: Set? + sourceSetRestriction: Set? ) = buildPlatformDependent( content.sourceSets.filter { @@ -173,7 +173,7 @@ open class HtmlRenderer( ) private fun FlowContent.buildPlatformDependent( - nodes: Map>, + nodes: Map>, pageContext: ContentPage, extra: PropertyContainer = PropertyContainer.empty(), styles: Set