aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-13 09:59:39 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-17 11:52:28 +0200
commitf6ac2b0f0a0183171aa2f6806ec67d8d21692a36 (patch)
treea912d7ba4d7d368b9a3683a6cf290ca135ee231a /plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt
parent86fcfb73d2d5124ae7748a80db29bdbb68607be4 (diff)
downloaddokka-f6ac2b0f0a0183171aa2f6806ec67d8d21692a36.tar.gz
dokka-f6ac2b0f0a0183171aa2f6806ec67d8d21692a36.tar.bz2
dokka-f6ac2b0f0a0183171aa2f6806ec67d8d21692a36.zip
Implement `ContentSourceSet`
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt')
-rw-r--r--plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt25
1 files changed, 12 insertions, 13 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt
index afee1b33..84be6df0 100644
--- a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt
+++ b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt
@@ -4,7 +4,6 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
-import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.resolvers.local.LocationProvider
import org.jetbrains.dokka.pages.*
@@ -30,7 +29,7 @@ abstract class DefaultRenderer<T>(
abstract fun T.buildList(
node: ContentList,
pageContext: ContentPage,
- sourceSetRestriction: Set<DokkaSourceSet>? = null
+ sourceSetRestriction: Set<ContentSourceSet>? = null
)
abstract fun T.buildNewLine()
@@ -38,7 +37,7 @@ abstract class DefaultRenderer<T>(
abstract fun T.buildTable(
node: ContentTable,
pageContext: ContentPage,
- sourceSetRestriction: Set<DokkaSourceSet>? = null
+ sourceSetRestriction: Set<ContentSourceSet>? = null
)
abstract fun T.buildText(textNode: ContentText)
@@ -50,13 +49,13 @@ abstract class DefaultRenderer<T>(
open fun T.buildPlatformDependent(
content: PlatformHintedContent,
pageContext: ContentPage,
- sourceSetRestriction: Set<DokkaSourceSet>?
+ sourceSetRestriction: Set<ContentSourceSet>?
) = buildContentNode(content.inner, pageContext)
open fun T.buildGroup(
node: ContentGroup,
pageContext: ContentPage,
- sourceSetRestriction: Set<DokkaSourceSet>? = null
+ sourceSetRestriction: Set<ContentSourceSet>? = null
) =
wrapGroup(node, pageContext) { node.children.forEach { it.build(this, pageContext, sourceSetRestriction) } }
@@ -69,7 +68,7 @@ abstract class DefaultRenderer<T>(
open fun T.buildLinkText(
nodes: List<ContentNode>,
pageContext: ContentPage,
- sourceSetRestriction: Set<DokkaSourceSet>? = null
+ sourceSetRestriction: Set<ContentSourceSet>? = null
) {
nodes.forEach { it.build(this, pageContext, sourceSetRestriction) }
}
@@ -85,7 +84,7 @@ abstract class DefaultRenderer<T>(
open fun T.buildHeader(
node: ContentHeader,
pageContext: ContentPage,
- sourceSetRestriction: Set<DokkaSourceSet>? = null
+ sourceSetRestriction: Set<ContentSourceSet>? = null
) {
buildHeader(node.level, node) { node.children.forEach { it.build(this, pageContext, sourceSetRestriction) } }
}
@@ -93,14 +92,14 @@ abstract class DefaultRenderer<T>(
open fun ContentNode.build(
builder: T,
pageContext: ContentPage,
- sourceSetRestriction: Set<DokkaSourceSet>? = null
+ sourceSetRestriction: Set<ContentSourceSet>? = null
) =
builder.buildContentNode(this, pageContext, sourceSetRestriction)
open fun T.buildContentNode(
node: ContentNode,
pageContext: ContentPage,
- sourceSetRestriction: Set<DokkaSourceSet>? = null
+ sourceSetRestriction: Set<ContentSourceSet>? = null
) {
if (sourceSetRestriction == null || node.sourceSets.any { it in sourceSetRestriction }) {
when (node) {
@@ -178,8 +177,8 @@ abstract class DefaultRenderer<T>(
protected fun ContentDivergentGroup.groupDivergentInstances(
pageContext: ContentPage,
- beforeTransformer: (ContentDivergentInstance, ContentPage, DokkaSourceSet) -> String,
- afterTransformer: (ContentDivergentInstance, ContentPage, DokkaSourceSet) -> String
+ beforeTransformer: (ContentDivergentInstance, ContentPage, ContentSourceSet) -> String,
+ afterTransformer: (ContentDivergentInstance, ContentPage, ContentSourceSet) -> String
): Map<SerializedBeforeAndAfter, List<InstanceWithSource>> =
children.flatMap { instance ->
instance.sourceSets.map { sourceSet ->
@@ -195,6 +194,6 @@ abstract class DefaultRenderer<T>(
}
internal typealias SerializedBeforeAndAfter = Pair<String, String>
-internal typealias InstanceWithSource = Pair<ContentDivergentInstance, DokkaSourceSet>
+internal typealias InstanceWithSource = Pair<ContentDivergentInstance, ContentSourceSet>
-fun ContentPage.sourceSets() = this.content.sourceSets \ No newline at end of file
+fun ContentPage.sourceSets() = this.content.sourceSets