aboutsummaryrefslogtreecommitdiff
path: root/plugins/base
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base')
-rw-r--r--plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt24
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt48
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt4
-rw-r--r--plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt4
-rw-r--r--plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt4
-rw-r--r--plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt4
-rw-r--r--plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt4
-rw-r--r--plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt36
-rw-r--r--plugins/base/src/main/kotlin/transformers/pages/merger/SourceSetMergingPageTransformer.kt8
-rw-r--r--plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt5
-rw-r--r--plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt4
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt2
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt24
13 files changed, 85 insertions, 86 deletions
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<T>(
abstract fun T.buildList(
node: ContentList,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>? = null
+ sourceSetRestriction: Set<DisplaySourceSet>? = null
)
abstract fun T.buildNewLine()
@@ -38,7 +38,7 @@ abstract class DefaultRenderer<T>(
abstract fun T.buildTable(
node: ContentTable,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>? = null
+ sourceSetRestriction: Set<DisplaySourceSet>? = null
)
abstract fun T.buildText(textNode: ContentText)
@@ -50,13 +50,13 @@ abstract class DefaultRenderer<T>(
open fun T.buildPlatformDependent(
content: PlatformHintedContent,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>?
+ sourceSetRestriction: Set<DisplaySourceSet>?
) = buildContentNode(content.inner, pageContext)
open fun T.buildGroup(
node: ContentGroup,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>? = null
+ sourceSetRestriction: Set<DisplaySourceSet>? = null
) =
wrapGroup(node, pageContext) { node.children.forEach { it.build(this, pageContext, sourceSetRestriction) } }
@@ -69,7 +69,7 @@ abstract class DefaultRenderer<T>(
open fun T.buildLinkText(
nodes: List<ContentNode>,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>? = null
+ sourceSetRestriction: Set<DisplaySourceSet>? = null
) {
nodes.forEach { it.build(this, pageContext, sourceSetRestriction) }
}
@@ -85,7 +85,7 @@ abstract class DefaultRenderer<T>(
open fun T.buildHeader(
node: ContentHeader,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>? = null
+ sourceSetRestriction: Set<DisplaySourceSet>? = null
) {
buildHeader(node.level, node) { node.children.forEach { it.build(this, pageContext, sourceSetRestriction) } }
}
@@ -93,14 +93,14 @@ abstract class DefaultRenderer<T>(
open fun ContentNode.build(
builder: T,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>? = null
+ sourceSetRestriction: Set<DisplaySourceSet>? = null
) =
builder.buildContentNode(this, pageContext, sourceSetRestriction)
open fun T.buildContentNode(
node: ContentNode,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>? = null
+ sourceSetRestriction: Set<DisplaySourceSet>? = null
) {
if (sourceSetRestriction == null || node.sourceSets.any { it in sourceSetRestriction }) {
when (node) {
@@ -178,8 +178,8 @@ abstract class DefaultRenderer<T>(
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<SerializedBeforeAndAfter, List<InstanceWithSource>> =
children.flatMap { instance ->
instance.sourceSets.map { sourceSet ->
@@ -195,6 +195,6 @@ abstract class DefaultRenderer<T>(
}
internal typealias SerializedBeforeAndAfter = Pair<String, String>
-internal typealias InstanceWithSource = Pair<ContentDivergentInstance, ContentSourceSet>
+internal typealias InstanceWithSource = Pair<ContentDivergentInstance, DisplaySourceSet>
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<ContentSourceSet>?
+ sourceSetRestriction: Set<DisplaySourceSet>?
) =
buildPlatformDependent(
content.sourceSets.filter {
@@ -173,7 +173,7 @@ open class HtmlRenderer(
)
private fun FlowContent.buildPlatformDependent(
- nodes: Map<ContentSourceSet, Collection<ContentNode>>,
+ nodes: Map<DisplaySourceSet, Collection<ContentNode>>,
pageContext: ContentPage,
extra: PropertyContainer<ContentNode> = PropertyContainer.empty(),
styles: Set<Style> = emptySet()
@@ -194,14 +194,14 @@ open class HtmlRenderer(
attributes["data-filterable-set"] = pair.first.sourceSetIDs.merged.toString()
if (index == 0) attributes["data-active"] = ""
attributes["data-toggle"] = pair.first.sourceSetIDs.merged.toString()
- when (pair.first.analysisPlatform.key) {
+ when (pair.first.platform.key) {
"common" -> classes = classes + "common-like"
"native" -> classes = classes + "native-like"
"jvm" -> classes = classes + "jvm-like"
"js" -> classes = classes + "js-like"
}
attributes["data-toggle"] = pair.first.sourceSetIDs.merged.toString()
- text(pair.first.displayName)
+ text(pair.first.name)
}
}
}
@@ -213,9 +213,9 @@ open class HtmlRenderer(
}
private fun contentsForSourceSetDependent(
- nodes: Map<ContentSourceSet, Collection<ContentNode>>,
+ nodes: Map<DisplaySourceSet, Collection<ContentNode>>,
pageContext: ContentPage,
- ): List<Pair<ContentSourceSet, String>> {
+ ): List<Pair<DisplaySourceSet, String>> {
var counter = 0
return nodes.toList().map { (sourceSet, elements) ->
sourceSet to createHTML(prettyPrint = false).div {
@@ -224,8 +224,8 @@ open class HtmlRenderer(
}
}.stripDiv()
}.groupBy(
- Pair<ContentSourceSet, String>::second,
- Pair<ContentSourceSet, String>::first
+ Pair<DisplaySourceSet, String>::second,
+ Pair<DisplaySourceSet, String>::first
).entries.flatMap { (html, sourceSets) ->
sourceSets.filterNot { sourceSet ->
sourceSet.sourceSetIDs.all.flatMap { sourceSetDependencyMap[it].orEmpty() }
@@ -314,14 +314,14 @@ open class HtmlRenderer(
override fun FlowContent.buildList(
node: ContentList,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>?
+ sourceSetRestriction: Set<DisplaySourceSet>?
) = if (node.ordered) ol { buildListItems(node.children, pageContext, sourceSetRestriction) }
else ul { buildListItems(node.children, pageContext, sourceSetRestriction) }
open fun OL.buildListItems(
items: List<ContentNode>,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>? = null
+ sourceSetRestriction: Set<DisplaySourceSet>? = null
) {
items.forEach {
if (it is ContentList)
@@ -334,7 +334,7 @@ open class HtmlRenderer(
open fun UL.buildListItems(
items: List<ContentNode>,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>? = null
+ sourceSetRestriction: Set<DisplaySourceSet>? = null
) {
items.forEach {
if (it is ContentList)
@@ -361,7 +361,7 @@ open class HtmlRenderer(
private fun FlowContent.buildRow(
node: ContentGroup,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>?,
+ sourceSetRestriction: Set<DisplaySourceSet>?,
style: Set<Style>
) {
node.children
@@ -414,18 +414,18 @@ open class HtmlRenderer(
}
}
- private fun FlowContent.createPlatformTagBubbles(sourceSets: List<ContentSourceSet>) {
+ private fun FlowContent.createPlatformTagBubbles(sourceSets: List<DisplaySourceSet>) {
if (shouldRenderSourceSetBubbles) {
div("platform-tags") {
sourceSets.forEach {
div("platform-tag") {
- 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)
}
}
}
@@ -434,7 +434,7 @@ open class HtmlRenderer(
private fun FlowContent.createPlatformTags(
node: ContentNode,
- sourceSetRestriction: Set<ContentSourceSet>? = null
+ sourceSetRestriction: Set<DisplaySourceSet>? = null
) {
node.takeIf { sourceSetRestriction == null || it.sourceSets.any { s -> s in sourceSetRestriction } }?.let {
createPlatformTagBubbles(node.sourceSets.filter {
@@ -446,7 +446,7 @@ open class HtmlRenderer(
override fun FlowContent.buildTable(
node: ContentTable,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>?
+ sourceSetRestriction: Set<DisplaySourceSet>?
) {
when (node.dci.kind) {
ContentKind.Comment -> buildDefaultTable(node, pageContext, sourceSetRestriction)
@@ -463,7 +463,7 @@ open class HtmlRenderer(
fun FlowContent.buildDefaultTable(
node: ContentTable,
pageContext: ContentPage,
- sourceSetRestriction: Set<ContentSourceSet>?
+ sourceSetRestriction: Set<DisplaySourceSet>?
) {
table {
thead {
@@ -548,7 +548,7 @@ open class HtmlRenderer(
fun FlowContent.buildLink(
to: DRI,
- platforms: List<ContentSourceSet>,
+ platforms: List<DisplaySourceSet>,
from: PageNode? = null,
block: FlowContent.() -> Unit
) = buildLink(locationProvider.resolve(to, platforms.toSet(), from), block)
@@ -588,7 +588,7 @@ open class HtmlRenderer(
private fun getSymbolSignature(page: ContentPage) = page.content.dfs { it.dci.kind == ContentKind.Symbol }
private fun flattenToText(node: ContentNode): String {
- fun getContentTextNodes(node: ContentNode, sourceSetRestriction: ContentSourceSet): List<ContentText> =
+ fun getContentTextNodes(node: ContentNode, sourceSetRestriction: DisplaySourceSet): List<ContentText> =
when (node) {
is ContentText -> listOf(node)
is ContentComposite -> node.children
@@ -600,7 +600,7 @@ open class HtmlRenderer(
}
val sourceSetRestriction =
- node.sourceSets.find { it.analysisPlatform == Platform.common } ?: node.sourceSets.first()
+ node.sourceSets.find { it.platform == Platform.common } ?: node.sourceSets.first()
return getContentTextNodes(node, sourceSetRestriction).joinToString("") { it.text }
}
diff --git a/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt b/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt
index 7c5d31f8..a6a16412 100644
--- a/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt
@@ -3,7 +3,7 @@ package org.jetbrains.dokka.base.renderers.html
import kotlinx.html.*
import kotlinx.html.stream.createHTML
import org.jetbrains.dokka.links.DRI
-import org.jetbrains.dokka.model.ContentSourceSet
+import org.jetbrains.dokka.model.DisplaySourceSet
import org.jetbrains.dokka.pages.PageNode
import org.jetbrains.dokka.pages.RendererSpecificPage
import org.jetbrains.dokka.pages.RenderingStrategy
@@ -41,7 +41,7 @@ class NavigationPage(val root: NavigationNode) : RendererSpecificPage {
class NavigationNode(
val name: String,
val dri: DRI,
- val sourceSets: Set<ContentSourceSet>,
+ val sourceSets: Set<DisplaySourceSet>,
val children: List<NavigationNode>
)
diff --git a/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt
index 9c9a0c0e..7387789b 100644
--- a/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt
@@ -3,7 +3,7 @@ package org.jetbrains.dokka.base.resolvers.local
import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.links.DRI
-import org.jetbrains.dokka.model.ContentSourceSet
+import org.jetbrains.dokka.model.DisplaySourceSet
import org.jetbrains.dokka.model.sourceSetIDs
import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.plugability.plugin
@@ -24,7 +24,7 @@ abstract class BaseLocationProvider(protected val dokkaContext: DokkaContext) :
protected fun getExternalLocation(
dri: DRI,
- sourceSets: Set<ContentSourceSet>
+ sourceSets: Set<DisplaySourceSet>
): String {
val jdkToExternalDocumentationLinks = dokkaContext.configuration.sourceSets
.filter { sourceSet -> sourceSet.sourceSetID in sourceSets.sourceSetIDs }
diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt
index c437b52a..b9df45ae 100644
--- a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt
@@ -4,7 +4,7 @@ import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.base.resolvers.anchors.SymbolAnchorHint
import org.jetbrains.dokka.base.resolvers.external.ExternalLocationProvider
import org.jetbrains.dokka.links.DRI
-import org.jetbrains.dokka.model.ContentSourceSet
+import org.jetbrains.dokka.model.DisplaySourceSet
import org.jetbrains.dokka.model.withDescendants
import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.plugability.DokkaContext
@@ -51,7 +51,7 @@ open class DefaultLocationProvider(
override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String =
pathTo(node, context) + if (!skipExtension) extension else ""
- override fun resolve(dri: DRI, sourceSets: Set<ContentSourceSet>, context: PageNode?): String =
+ override fun resolve(dri: DRI, sourceSets: Set<DisplaySourceSet>, context: PageNode?): String =
pagesIndex[dri]?.let { resolve(it, context) }
?: anchorsIndex[dri]?.let { resolve(it, context) + "#$dri" }
// Not found in PageGraph, that means it's an external link
diff --git a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt
index d95594cf..5077195f 100644
--- a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt
@@ -1,12 +1,12 @@
package org.jetbrains.dokka.base.resolvers.local
import org.jetbrains.dokka.links.DRI
-import org.jetbrains.dokka.model.ContentSourceSet
+import org.jetbrains.dokka.model.DisplaySourceSet
import org.jetbrains.dokka.pages.PageNode
import org.jetbrains.dokka.pages.RootPageNode
interface LocationProvider {
- fun resolve(dri: DRI, sourceSets: Set<ContentSourceSet>, context: PageNode? = null): String
+ fun resolve(dri: DRI, sourceSets: Set<DisplaySourceSet>, context: PageNode? = null): String
fun resolve(node: PageNode, context: PageNode? = null, skipExtension: Boolean = false): String
fun resolveRoot(node: PageNode): String
fun ancestors(node: PageNode): List<PageNode>
diff --git a/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt
index 3f903bb3..75c2ccf6 100644
--- a/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt
@@ -1,7 +1,7 @@
package org.jetbrains.dokka.base.resolvers.local
import org.jetbrains.dokka.links.DRI
-import org.jetbrains.dokka.model.ContentSourceSet
+import org.jetbrains.dokka.model.DisplaySourceSet
import org.jetbrains.dokka.pages.PageNode
import org.jetbrains.dokka.pages.RootPageNode
import org.jetbrains.dokka.plugability.DokkaContext
@@ -14,7 +14,7 @@ class MultimoduleLocationProvider(private val root: RootPageNode, context: Dokka
it.name to it.path
}.toMap()
- override fun resolve(dri: DRI, sourceSets: Set<ContentSourceSet>, context: PageNode?): String =
+ override fun resolve(dri: DRI, sourceSets: Set<DisplaySourceSet>, context: PageNode?): String =
dri.takeIf { it.packageName == MULTIMODULE_PACKAGE_PLACEHOLDER }?.classNames?.let { paths[it] }?.let {
"$it/${identifierToFilename(dri.classNames.orEmpty())}/index.html"
} ?: defaultLocationProvider.resolve(dri, sourceSets, context)
diff --git a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt
index f5181f4a..0c88b3c6 100644
--- a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt
+++ b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt
@@ -3,7 +3,7 @@ package org.jetbrains.dokka.base.transformers.pages.comments
import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
import org.jetbrains.dokka.model.doc.*
import org.jetbrains.dokka.model.properties.PropertyContainer
-import org.jetbrains.dokka.model.toContentSourceSets
+import org.jetbrains.dokka.model.toDisplaySourceSets
import org.jetbrains.dokka.pages.*
object DocTagToContentConverter : CommentsToContentConverter {
@@ -31,7 +31,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
buildChildren(docTag),
level,
dci,
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles
)
)
@@ -42,7 +42,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
buildChildren(docTag),
ordered,
dci,
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles,
((PropertyContainer.empty<ContentNode>()) + SimpleAttr("start", start.toString()))
)
@@ -50,7 +50,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
fun buildNewLine() = listOf(
ContentBreakLine(
- sourceSets.toContentSourceSets()
+ sourceSets.toDisplaySourceSets()
)
)
@@ -67,7 +67,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
is Ul -> buildList(false)
is Ol -> buildList(true, docTag.params["start"]?.toInt() ?: 1)
is Li -> listOf(
- ContentGroup(buildChildren(docTag), dci, sourceSets.toContentSourceSets(), styles, extra)
+ ContentGroup(buildChildren(docTag), dci, sourceSets.toDisplaySourceSets(), styles, extra)
)
is Br -> buildNewLine()
is B -> buildChildren(docTag, setOf(TextStyle.Strong))
@@ -76,7 +76,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
ContentGroup(
buildChildren(docTag.collapseParagraphs()),
dci,
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles + setOf(TextStyle.Paragraph),
extra
)
@@ -86,7 +86,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
buildChildren(docTag),
docTag.params.getValue("href"),
dci,
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles
)
)
@@ -98,7 +98,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
setOf(docTag.dri),
ContentKind.Main
),
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles
)
)
@@ -107,7 +107,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
buildChildren(docTag),
"",
dci,
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles
)
)
@@ -116,7 +116,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
buildChildren(docTag),
"",
dci,
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles
)
)
@@ -125,7 +125,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
buildChildren(docTag),
"",
dci,
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles
)
)
@@ -134,7 +134,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
address = docTag.params["href"]!!,
altText = docTag.params["alt"],
dci = dci,
- sourceSets = sourceSets.toContentSourceSets(),
+ sourceSets = sourceSets.toDisplaySourceSets(),
style = styles,
extra = extra
)
@@ -143,7 +143,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
ContentText(
"",
dci,
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
setOf()
)
)
@@ -151,7 +151,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
ContentText(
docTag.body,
dci,
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles
)
)
@@ -161,7 +161,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
buildTableRows(docTag.children.filterIsInstance<Th>(), CommentTable),
buildTableRows(docTag.children.filterIsInstance<Tr>(), CommentTable),
dci,
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles + CommentTable
)
)
@@ -169,10 +169,10 @@ object DocTagToContentConverter : CommentsToContentConverter {
is Tr -> listOf(
ContentGroup(
docTag.children.map {
- ContentGroup(buildChildren(it), dci, sourceSets.toContentSourceSets(), styles, extra)
+ ContentGroup(buildChildren(it), dci, sourceSets.toDisplaySourceSets(), styles, extra)
},
dci,
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles
)
)
@@ -180,7 +180,7 @@ object DocTagToContentConverter : CommentsToContentConverter {
ContentGroup(
buildChildren(docTag, newStyles = styles + ContentStyle.InDocumentationAnchor),
dci,
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles
)
)
diff --git a/plugins/base/src/main/kotlin/transformers/pages/merger/SourceSetMergingPageTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/merger/SourceSetMergingPageTransformer.kt
index ca1a7e3b..61e72abf 100644
--- a/plugins/base/src/main/kotlin/transformers/pages/merger/SourceSetMergingPageTransformer.kt
+++ b/plugins/base/src/main/kotlin/transformers/pages/merger/SourceSetMergingPageTransformer.kt
@@ -1,15 +1,15 @@
package org.jetbrains.dokka.base.transformers.pages.merger
import org.jetbrains.dokka.Platform
-import org.jetbrains.dokka.model.ContentSourceSet
-import org.jetbrains.dokka.model.toContentSourceSets
+import org.jetbrains.dokka.model.DisplaySourceSet
+import org.jetbrains.dokka.model.toDisplaySourceSets
import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.transformers.pages.PageTransformer
class SourceSetMergingPageTransformer(context: DokkaContext) : PageTransformer {
- private val mergedSourceSets = context.configuration.sourceSets.toContentSourceSets()
+ private val mergedSourceSets = context.configuration.sourceSets.toDisplaySourceSets()
.associateBy { sourceSet -> sourceSet.key }
override fun invoke(input: RootPageNode): RootPageNode {
@@ -33,6 +33,6 @@ class SourceSetMergingPageTransformer(context: DokkaContext) : PageTransformer {
}
}
-private val ContentSourceSet.key get() = SourceSetMergingKey(displayName, analysisPlatform)
+private val DisplaySourceSet.key get() = SourceSetMergingKey(name, platform)
private data class SourceSetMergingKey(private val displayName: String, private val platform: Platform)
diff --git a/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt
index c7202a0b..2099cab5 100644
--- a/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt
+++ b/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt
@@ -9,7 +9,7 @@ import org.jetbrains.dokka.analysis.DokkaResolutionFacade
import org.jetbrains.dokka.analysis.EnvironmentAndFacade
import org.jetbrains.dokka.base.renderers.sourceSets
import org.jetbrains.dokka.links.DRI
-import org.jetbrains.dokka.model.ContentSourceSet
+import org.jetbrains.dokka.model.DisplaySourceSet
import org.jetbrains.dokka.model.doc.Sample
import org.jetbrains.dokka.model.properties.PropertyContainer
import org.jetbrains.dokka.pages.*
@@ -20,7 +20,6 @@ import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
import org.jetbrains.kotlin.utils.PathUtil
-import java.io.File
abstract class SamplesTransformer(val context: DokkaContext) : PageTransformer {
@@ -126,7 +125,7 @@ abstract class SamplesTransformer(val context: DokkaContext) : PageTransformer {
}
private fun contentCode(
- sourceSets: Set<ContentSourceSet>,
+ sourceSets: Set<DisplaySourceSet>,
dri: Set<DRI>,
content: String,
language: String,
diff --git a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt
index f0cf8597..8eb7208b 100644
--- a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt
+++ b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt
@@ -9,7 +9,7 @@ import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
import org.jetbrains.dokka.analysis.DescriptorDocumentableSource
import org.jetbrains.dokka.analysis.PsiDocumentableSource
import org.jetbrains.dokka.model.WithExpectActual
-import org.jetbrains.dokka.model.toContentSourceSets
+import org.jetbrains.dokka.model.toDisplaySourceSets
import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.transformers.pages.PageTransformer
@@ -67,7 +67,7 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent
}
},
DCI(node.dri, ContentKind.Source),
- node.documentable!!.sourceSets.toContentSourceSets(),
+ node.documentable!!.sourceSets.toDisplaySourceSets(),
style = emptySet(),
extra = mainExtra + SimpleAttr.header("Sources")
)
diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
index 04b29990..3f3e157e 100644
--- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
+++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
@@ -159,7 +159,7 @@ open class DefaultPageCreator(
}
},
DCI(setOf(dri), ContentKind.Inheritors),
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
style = emptySet(),
extra = mainExtra + SimpleAttr.header("Inheritors")
)
diff --git a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt
index 9d4f6a9e..a1f3c002 100644
--- a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt
+++ b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt
@@ -9,7 +9,7 @@ import org.jetbrains.dokka.model.Documentable
import org.jetbrains.dokka.model.SourceSetDependent
import org.jetbrains.dokka.model.doc.DocTag
import org.jetbrains.dokka.model.properties.PropertyContainer
-import org.jetbrains.dokka.model.toContentSourceSets
+import org.jetbrains.dokka.model.toDisplaySourceSets
import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.utilities.DokkaLogger
@@ -74,7 +74,7 @@ open class PageContentBuilder(
) = ContentGroup(
contents.toList(),
DCI(mainDRI, kind),
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles,
extra
)
@@ -154,7 +154,7 @@ open class PageContentBuilder(
defaultHeaders,
operation(),
DCI(mainDRI, kind),
- sourceSets.toContentSourceSets(), styles, extra
+ sourceSets.toDisplaySourceSets(), styles, extra
)
}
@@ -189,7 +189,7 @@ open class PageContentBuilder(
}
},
DCI(mainDRI, kind),
- sourceSets.toContentSourceSets(), styles, extra
+ sourceSets.toDisplaySourceSets(), styles, extra
)
}
}
@@ -235,7 +235,7 @@ open class PageContentBuilder(
listOf(createText(text, kind, sourceSets, styles, extra)),
address,
DCI(mainDRI, kind),
- sourceSets.toContentSourceSets()
+ sourceSets.toDisplaySourceSets()
)
fun link(
@@ -251,7 +251,7 @@ open class PageContentBuilder(
address = address,
extra = PropertyContainer.empty(),
dci = DCI(mainDRI, kind),
- sourceSets = sourceSets.toContentSourceSets(),
+ sourceSets = sourceSets.toDisplaySourceSets(),
style = emptySet()
)
}
@@ -268,7 +268,7 @@ open class PageContentBuilder(
contentFor(mainDRI, sourceSets, kind, styles, extra, block).children,
address,
DCI(mainDRI, kind),
- sourceSets.toContentSourceSets()
+ sourceSets.toDisplaySourceSets()
)
}
@@ -284,7 +284,7 @@ open class PageContentBuilder(
DCI(mainDRI, kind),
sourceSets
)
- contents += ContentGroup(content, DCI(mainDRI, kind), sourceSets.toContentSourceSets(), styles, extra)
+ contents += ContentGroup(content, DCI(mainDRI, kind), sourceSets.toDisplaySourceSets(), styles, extra)
}
fun group(
@@ -332,7 +332,7 @@ open class PageContentBuilder(
) {
contents += PlatformHintedContent(
buildGroup(dri, sourceSets, kind, styles, extra, block),
- sourceSets.toContentSourceSets()
+ sourceSets.toDisplaySourceSets()
)
}
@@ -346,7 +346,7 @@ open class PageContentBuilder(
) {
contents += PlatformHintedContent(
buildGroup(setOf(dri), sourcesetData, kind, styles, extra, block),
- sourcesetData.toContentSourceSets()
+ sourcesetData.toDisplaySourceSets()
)
}
@@ -357,7 +357,7 @@ open class PageContentBuilder(
styles: Set<Style>,
extra: PropertyContainer<ContentNode>
) =
- ContentText(text, DCI(mainDRI, kind), sourceSets.toContentSourceSets(), styles, extra)
+ ContentText(text, DCI(mainDRI, kind), sourceSets.toDisplaySourceSets(), styles, extra)
fun <T> sourceSetDependentText(
value: SourceSetDependent<T>,
@@ -467,7 +467,7 @@ open class PageContentBuilder(
divergent ?: throw IllegalStateException("Divergent block needs divergent part"),
after,
DCI(mainDRI, kind),
- sourceSets.toContentSourceSets(),
+ sourceSets.toDisplaySourceSets(),
styles,
extra
)