aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/transformers
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-11-10 11:46:54 +0100
committerGitHub <noreply@github.com>2023-11-10 11:46:54 +0100
commit8e5c63d035ef44a269b8c43430f43f5c8eebfb63 (patch)
tree1b915207b2b9f61951ddbf0ff2e687efd053d555 /core/src/main/kotlin/transformers
parenta44efd4ba0c2e4ab921ff75e0f53fc9335aa79db (diff)
downloaddokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.gz
dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.bz2
dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.zip
Restructure the project to utilize included builds (#3174)
* Refactor and simplify artifact publishing * Update Gradle to 8.4 * Refactor and simplify convention plugins and build scripts Fixes #3132 --------- Co-authored-by: Adam <897017+aSemy@users.noreply.github.com> Co-authored-by: Oleg Yukhnevich <whyoleg@gmail.com>
Diffstat (limited to 'core/src/main/kotlin/transformers')
-rw-r--r--core/src/main/kotlin/transformers/documentation/DefaultDocumentableMerger.kt307
-rw-r--r--core/src/main/kotlin/transformers/documentation/DocumentableMerger.kt12
-rw-r--r--core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt13
-rw-r--r--core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt12
-rw-r--r--core/src/main/kotlin/transformers/documentation/PreMergeDocumentableTransformer.kt39
-rw-r--r--core/src/main/kotlin/transformers/pages/PageCreator.kt15
-rw-r--r--core/src/main/kotlin/transformers/pages/PageTransformer.kt11
-rw-r--r--core/src/main/kotlin/transformers/pages/PageTransformerBuilders.kt27
-rw-r--r--core/src/main/kotlin/transformers/sources/AsyncSourceToDocumentableTranslator.kt20
-rw-r--r--core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt13
10 files changed, 0 insertions, 469 deletions
diff --git a/core/src/main/kotlin/transformers/documentation/DefaultDocumentableMerger.kt b/core/src/main/kotlin/transformers/documentation/DefaultDocumentableMerger.kt
deleted file mode 100644
index fe1e5d64..00000000
--- a/core/src/main/kotlin/transformers/documentation/DefaultDocumentableMerger.kt
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
- */
-
-package org.jetbrains.dokka.transformers.documentation
-
-import org.jetbrains.dokka.DokkaConfiguration
-import org.jetbrains.dokka.InternalDokkaApi
-import org.jetbrains.dokka.model.*
-import org.jetbrains.dokka.model.properties.ExtraProperty
-import org.jetbrains.dokka.model.properties.MergeStrategy
-import org.jetbrains.dokka.model.properties.mergeExtras
-import org.jetbrains.dokka.plugability.DokkaContext
-import org.jetbrains.dokka.CoreExtensions
-
-/**
- * Should NOT be used outside of Dokka itself, there are no guarantees
- * this class will continue to exist in future releases.
- *
- * This class resides in core because it is a non-trivial implementation
- * for a core extension [CoreExtensions.documentableMerger], which is needed
- * in modules that only have access to `dokka-core`.
- */
-@InternalDokkaApi
-public class DefaultDocumentableMerger(context: DokkaContext) : DocumentableMerger {
- private val dependencyInfo = context.getDependencyInfo()
-
- override fun invoke(modules: Collection<DModule>): DModule? =
- modules.reduceOrNull { left, right ->
- val list = listOf(left, right)
- DModule(
- name = modules.map { it.name }.distinct().joinToString("|"),
- packages = merge(
- list.flatMap { it.packages }
- ) { pck1, pck2 -> pck1.mergeWith(pck2) },
- documentation = list.map { it.documentation }.flatMap { it.entries }.associate { (k, v) -> k to v },
- expectPresentInSet = list.firstNotNullOfOrNull { it.expectPresentInSet },
- sourceSets = list.flatMap { it.sourceSets }.toSet()
- ).mergeExtras(left, right)
- }
-
- private fun DokkaContext.getDependencyInfo()
- : Map<DokkaConfiguration.DokkaSourceSet, List<DokkaConfiguration.DokkaSourceSet>> {
-
- fun getDependencies(sourceSet: DokkaConfiguration.DokkaSourceSet): List<DokkaConfiguration.DokkaSourceSet> =
- listOf(sourceSet) + configuration.sourceSets.filter {
- it.sourceSetID in sourceSet.dependentSourceSets
- }.flatMap { getDependencies(it) }
-
- return configuration.sourceSets.associateWith { getDependencies(it) }
- }
-
- private fun <T : Documentable> merge(elements: List<T>, reducer: (T, T) -> T): List<T> =
- elements.groupingBy { it.dri }
- .reduce { _, left, right -> reducer(left, right) }
- .values.toList()
-
- private fun <T> mergeExpectActual(
- elements: List<T>,
- reducer: (T, T) -> T
- ): List<T> where T : Documentable, T : WithSources {
-
- fun mergeClashingElements(elements: List<Pair<T, Set<DokkaConfiguration.DokkaSourceSet>>>): List<T> =
- elements.groupBy { it.first.name }.values.flatMap { listOfDocumentableToSSIds ->
- val merged = listOfDocumentableToSSIds.map { (documentable, sourceSets) ->
- when (documentable) {
- is DClass -> documentable.copy(
- extra = documentable.extra + ClashingDriIdentifier(
- sourceSets + (documentable.extra[ClashingDriIdentifier]?.value ?: emptySet())
- )
- )
- is DObject -> documentable.copy(
- extra = documentable.extra + ClashingDriIdentifier(
- sourceSets + (documentable.extra[ClashingDriIdentifier]?.value ?: emptySet())
- )
- )
- is DAnnotation -> documentable.copy(
- extra = documentable.extra + ClashingDriIdentifier(
- sourceSets + (documentable.extra[ClashingDriIdentifier]?.value ?: emptySet())
- )
- )
- is DInterface -> documentable.copy(
- extra = documentable.extra + ClashingDriIdentifier(
- sourceSets + (documentable.extra[ClashingDriIdentifier]?.value ?: emptySet())
- )
- )
- is DEnum -> documentable.copy(
- extra = documentable.extra + ClashingDriIdentifier(
- sourceSets + (documentable.extra[ClashingDriIdentifier]?.value ?: emptySet())
- )
- )
- is DFunction -> documentable.copy(
- extra = documentable.extra + ClashingDriIdentifier(
- sourceSets + (documentable.extra[ClashingDriIdentifier]?.value ?: emptySet())
- )
- )
- is DProperty -> documentable.copy(
- extra = documentable.extra + ClashingDriIdentifier(
- sourceSets + (documentable.extra[ClashingDriIdentifier]?.value ?: emptySet())
- )
- )
- else -> documentable
- }
- }
- @Suppress("UNCHECKED_CAST")
- merged as List<T>
- }
-
-
- fun analyzeExpectActual(sameDriElements: List<T>): List<T> {
- val (expects, actuals) = sameDriElements.partition { it.expectPresentInSet != null }
- val groupedByOwnExpectWithActualSourceSetIds = expects.map { expect ->
- val actualsForGivenExpect = actuals.filter { actual ->
- dependencyInfo[actual.sourceSets.single()]
- ?.contains(expect.expectPresentInSet!!)
- ?: throw IllegalStateException("Cannot resolve expect/actual relation for ${actual.name}")
- }
- (listOf(expect) + actualsForGivenExpect) to actualsForGivenExpect.flatMap { it.sourceSets }.toSet()
- }
- val reducedToOneDocumentableWithActualSourceSetIds =
- groupedByOwnExpectWithActualSourceSetIds.map { it.first.reduce(reducer) to it.second }
- return reducedToOneDocumentableWithActualSourceSetIds.let(::mergeClashingElements)
- }
-
-
- return elements.partition {
- (it as? WithIsExpectActual)?.isExpectActual ?: false
- }.let { (expectActuals, notExpectActuals) ->
- notExpectActuals.map { it to it.sourceSets }
- .groupBy { it.first.dri }.values.flatMap(::mergeClashingElements) +
- expectActuals.groupBy { it.dri }.values.flatMap(::analyzeExpectActual)
- }
- }
-
- public fun DPackage.mergeWith(other: DPackage): DPackage = copy(
- functions = mergeExpectActual(functions + other.functions) { f1, f2 -> f1.mergeWith(f2) },
- properties = mergeExpectActual(properties + other.properties) { p1, p2 -> p1.mergeWith(p2) },
- classlikes = mergeExpectActual(classlikes + other.classlikes) { c1, c2 -> c1.mergeWith(c2) },
- documentation = documentation + other.documentation,
- expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet,
- typealiases = merge(typealiases + other.typealiases) { ta1, ta2 -> ta1.mergeWith(ta2) },
- sourceSets = sourceSets + other.sourceSets
- ).mergeExtras(this, other)
-
- public fun DFunction.mergeWith(other: DFunction): DFunction = copy(
- parameters = merge(this.parameters + other.parameters) { p1, p2 -> p1.mergeWith(p2) },
- receiver = receiver?.let { r -> other.receiver?.let { r.mergeWith(it) } ?: r } ?: other.receiver,
- documentation = documentation + other.documentation,
- expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet,
- sources = sources + other.sources,
- visibility = visibility + other.visibility,
- modifier = modifier + other.modifier,
- sourceSets = sourceSets + other.sourceSets,
- generics = merge(generics + other.generics) { tp1, tp2 -> tp1.mergeWith(tp2) },
- ).mergeExtras(this, other)
-
- public fun DProperty.mergeWith(other: DProperty): DProperty = copy(
- receiver = receiver?.let { r -> other.receiver?.let { r.mergeWith(it) } ?: r } ?: other.receiver,
- documentation = documentation + other.documentation,
- expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet,
- sources = sources + other.sources,
- visibility = visibility + other.visibility,
- modifier = modifier + other.modifier,
- sourceSets = sourceSets + other.sourceSets,
- getter = getter?.let { g -> other.getter?.let { g.mergeWith(it) } ?: g } ?: other.getter,
- setter = setter?.let { s -> other.setter?.let { s.mergeWith(it) } ?: s } ?: other.setter,
- generics = merge(generics + other.generics) { tp1, tp2 -> tp1.mergeWith(tp2) },
- ).mergeExtras(this, other)
-
- private fun DClasslike.mergeWith(other: DClasslike): DClasslike = when {
- this is DClass && other is DClass -> mergeWith(other)
- this is DEnum && other is DEnum -> mergeWith(other)
- this is DInterface && other is DInterface -> mergeWith(other)
- this is DObject && other is DObject -> mergeWith(other)
- this is DAnnotation && other is DAnnotation -> mergeWith(other)
- else -> throw IllegalStateException("${this::class.qualifiedName} ${this.name} cannot be merged with ${other::class.qualifiedName} ${other.name}")
- }
-
- private fun DClass.mergeWith(other: DClass): DClass = copy(
- constructors = mergeExpectActual(
- constructors + other.constructors
- ) { f1, f2 -> f1.mergeWith(f2) },
- functions = mergeExpectActual(functions + other.functions) { f1, f2 -> f1.mergeWith(f2) },
- properties = mergeExpectActual(properties + other.properties) { p1, p2 -> p1.mergeWith(p2) },
- classlikes = mergeExpectActual(classlikes + other.classlikes) { c1, c2 -> c1.mergeWith(c2) },
- companion = companion?.let { c -> other.companion?.let { c.mergeWith(it) } ?: c } ?: other.companion,
- generics = merge(generics + other.generics) { tp1, tp2 -> tp1.mergeWith(tp2) },
- modifier = modifier + other.modifier,
- supertypes = supertypes + other.supertypes,
- documentation = documentation + other.documentation,
- expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet,
- sources = sources + other.sources,
- visibility = visibility + other.visibility,
- sourceSets = sourceSets + other.sourceSets
- ).mergeExtras(this, other)
-
- private fun DEnum.mergeWith(other: DEnum): DEnum = copy(
- entries = merge(entries + other.entries) { ee1, ee2 -> ee1.mergeWith(ee2) },
- constructors = mergeExpectActual(
- constructors + other.constructors
- ) { f1, f2 -> f1.mergeWith(f2) },
- functions = mergeExpectActual(functions + other.functions) { f1, f2 -> f1.mergeWith(f2) },
- properties = mergeExpectActual(properties + other.properties) { p1, p2 -> p1.mergeWith(p2) },
- classlikes = mergeExpectActual(classlikes + other.classlikes) { c1, c2 -> c1.mergeWith(c2) },
- companion = companion?.let { c -> other.companion?.let { c.mergeWith(it) } ?: c } ?: other.companion,
- supertypes = supertypes + other.supertypes,
- documentation = documentation + other.documentation,
- expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet,
- sources = sources + other.sources,
- visibility = visibility + other.visibility,
- sourceSets = sourceSets + other.sourceSets
- ).mergeExtras(this, other)
-
- private fun DEnumEntry.mergeWith(other: DEnumEntry): DEnumEntry = copy(
- functions = mergeExpectActual(functions + other.functions) { f1, f2 -> f1.mergeWith(f2) },
- properties = mergeExpectActual(properties + other.properties) { p1, p2 -> p1.mergeWith(p2) },
- classlikes = mergeExpectActual(classlikes + other.classlikes) { c1, c2 -> c1.mergeWith(c2) },
- documentation = documentation + other.documentation,
- expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet,
- sourceSets = sourceSets + other.sourceSets
- ).mergeExtras(this, other)
-
- private fun DObject.mergeWith(other: DObject): DObject = copy(
- functions = mergeExpectActual(functions + other.functions) { f1, f2 -> f1.mergeWith(f2) },
- properties = mergeExpectActual(properties + other.properties) { p1, p2 -> p1.mergeWith(p2) },
- classlikes = mergeExpectActual(classlikes + other.classlikes) { c1, c2 -> c1.mergeWith(c2) },
- supertypes = supertypes + other.supertypes,
- documentation = documentation + other.documentation,
- expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet,
- sources = sources + other.sources,
- visibility = visibility + other.visibility,
- sourceSets = sourceSets + other.sourceSets
- ).mergeExtras(this, other)
-
- private fun DInterface.mergeWith(other: DInterface): DInterface = copy(
- functions = mergeExpectActual(functions + other.functions) { f1, f2 -> f1.mergeWith(f2) },
- properties = mergeExpectActual(properties + other.properties) { p1, p2 -> p1.mergeWith(p2) },
- classlikes = mergeExpectActual(classlikes + other.classlikes) { c1, c2 -> c1.mergeWith(c2) },
- companion = companion?.let { c -> other.companion?.let { c.mergeWith(it) } ?: c } ?: other.companion,
- generics = merge(generics + other.generics) { tp1, tp2 -> tp1.mergeWith(tp2) },
- supertypes = supertypes + other.supertypes,
- documentation = documentation + other.documentation,
- expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet,
- sources = sources + other.sources,
- visibility = visibility + other.visibility,
- sourceSets = sourceSets + other.sourceSets
- ).mergeExtras(this, other)
-
- private fun DAnnotation.mergeWith(other: DAnnotation): DAnnotation = copy(
- constructors = mergeExpectActual(
- constructors + other.constructors
- ) { f1, f2 -> f1.mergeWith(f2) },
- functions = mergeExpectActual(functions + other.functions) { f1, f2 -> f1.mergeWith(f2) },
- properties = mergeExpectActual(properties + other.properties) { p1, p2 -> p1.mergeWith(p2) },
- classlikes = mergeExpectActual(classlikes + other.classlikes) { c1, c2 -> c1.mergeWith(c2) },
- companion = companion?.let { c -> other.companion?.let { c.mergeWith(it) } ?: c } ?: other.companion,
- documentation = documentation + other.documentation,
- expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet,
- sources = sources + other.sources,
- visibility = visibility + other.visibility,
- sourceSets = sourceSets + other.sourceSets,
- generics = merge(generics + other.generics) { tp1, tp2 -> tp1.mergeWith(tp2) }
- ).mergeExtras(this, other)
-
- private fun DParameter.mergeWith(other: DParameter): DParameter = copy(
- documentation = documentation + other.documentation,
- expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet,
- sourceSets = sourceSets + other.sourceSets
- ).mergeExtras(this, other)
-
- private fun DTypeParameter.mergeWith(other: DTypeParameter): DTypeParameter = copy(
- documentation = documentation + other.documentation,
- expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet,
- sourceSets = sourceSets + other.sourceSets
- ).mergeExtras(this, other)
-
- private fun DTypeAlias.mergeWith(other: DTypeAlias): DTypeAlias = copy(
- documentation = documentation + other.documentation,
- expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet,
- underlyingType = underlyingType + other.underlyingType,
- visibility = visibility + other.visibility,
- sourceSets = sourceSets + other.sourceSets
- ).mergeExtras(this, other)
-}
-
-public data class ClashingDriIdentifier(val value: Set<DokkaConfiguration.DokkaSourceSet>) : ExtraProperty<Documentable> {
- public companion object : ExtraProperty.Key<Documentable, ClashingDriIdentifier> {
- override fun mergeStrategyFor(
- left: ClashingDriIdentifier,
- right: ClashingDriIdentifier
- ): MergeStrategy<Documentable> =
- MergeStrategy.Replace(ClashingDriIdentifier(left.value + right.value))
- }
-
- override val key: ExtraProperty.Key<Documentable, *> = ClashingDriIdentifier
-}
-
-// TODO [beresnev] remove this copy-paste and use the same method from stdlib instead after updating to 1.5
-private inline fun <T, R : Any> Iterable<T>.firstNotNullOfOrNull(transform: (T) -> R?): R? {
- for (element in this) {
- val result = transform(element)
- if (result != null) {
- return result
- }
- }
- return null
-}
diff --git a/core/src/main/kotlin/transformers/documentation/DocumentableMerger.kt b/core/src/main/kotlin/transformers/documentation/DocumentableMerger.kt
deleted file mode 100644
index aff1f763..00000000
--- a/core/src/main/kotlin/transformers/documentation/DocumentableMerger.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
- */
-
-package org.jetbrains.dokka.transformers.documentation
-
-import org.jetbrains.dokka.model.DModule
-
-public fun interface DocumentableMerger {
- public operator fun invoke(modules: Collection<DModule>): DModule?
-}
-
diff --git a/core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt b/core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt
deleted file mode 100644
index ad35ab1d..00000000
--- a/core/src/main/kotlin/transformers/documentation/DocumentableToPageTranslator.kt
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
- */
-
-package org.jetbrains.dokka.transformers.documentation
-
-import org.jetbrains.dokka.model.DModule
-import org.jetbrains.dokka.pages.RootPageNode
-
-public fun interface DocumentableToPageTranslator {
- public operator fun invoke(module: DModule): RootPageNode
-}
-
diff --git a/core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt b/core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt
deleted file mode 100644
index f680b9f3..00000000
--- a/core/src/main/kotlin/transformers/documentation/DocumentableTransformer.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
- */
-
-package org.jetbrains.dokka.transformers.documentation
-
-import org.jetbrains.dokka.model.DModule
-import org.jetbrains.dokka.plugability.DokkaContext
-
-public fun interface DocumentableTransformer {
- public operator fun invoke(original: DModule, context: DokkaContext): DModule
-}
diff --git a/core/src/main/kotlin/transformers/documentation/PreMergeDocumentableTransformer.kt b/core/src/main/kotlin/transformers/documentation/PreMergeDocumentableTransformer.kt
deleted file mode 100644
index 8ae28605..00000000
--- a/core/src/main/kotlin/transformers/documentation/PreMergeDocumentableTransformer.kt
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
- */
-
-package org.jetbrains.dokka.transformers.documentation
-
-import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
-import org.jetbrains.dokka.DokkaConfiguration.PackageOptions
-import org.jetbrains.dokka.model.DModule
-import org.jetbrains.dokka.model.Documentable
-import org.jetbrains.dokka.model.DocumentableSource
-import org.jetbrains.dokka.model.WithSources
-
-public interface PreMergeDocumentableTransformer {
- public operator fun invoke(modules: List<DModule>): List<DModule>
-}
-
-/**
- * It is fair to assume that a given [Documentable] is not merged when seen by the [PreMergeDocumentableTransformer].
- * Therefore, it can also be assumed, that there is just a single source set connected to the given [documentable]
- * @return the single source set associated with this [documentable].
- */
-@Suppress("UnusedReceiverParameter") // Receiver is used for scoping this function
-public fun PreMergeDocumentableTransformer.sourceSet(documentable: Documentable): DokkaSourceSet {
- return documentable.sourceSets.single()
-}
-
-/**
- * @return The [PackageOptions] associated with this documentable, or null
- */
-public fun PreMergeDocumentableTransformer.perPackageOptions(documentable: Documentable): PackageOptions? {
- val packageName = documentable.dri.packageName ?: return null
- return sourceSet(documentable).perPackageOptions
- .sortedByDescending { packageOptions -> packageOptions.matchingRegex.length }
- .firstOrNull { packageOptions -> Regex(packageOptions.matchingRegex).matches(packageName) }
-}
-
-public fun <T> PreMergeDocumentableTransformer.source(documentable: T): DocumentableSource where T : Documentable, T : WithSources =
- checkNotNull(documentable.sources[sourceSet(documentable)])
diff --git a/core/src/main/kotlin/transformers/pages/PageCreator.kt b/core/src/main/kotlin/transformers/pages/PageCreator.kt
deleted file mode 100644
index 8c008f04..00000000
--- a/core/src/main/kotlin/transformers/pages/PageCreator.kt
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
- */
-
-package org.jetbrains.dokka.transformers.pages
-
-import org.jetbrains.dokka.pages.RootPageNode
-
-public interface CreationContext
-
-public object NoCreationContext : CreationContext
-
-public interface PageCreator<T: CreationContext> {
- public operator fun invoke(creationContext: T): RootPageNode
-}
diff --git a/core/src/main/kotlin/transformers/pages/PageTransformer.kt b/core/src/main/kotlin/transformers/pages/PageTransformer.kt
deleted file mode 100644
index b2bbc1d1..00000000
--- a/core/src/main/kotlin/transformers/pages/PageTransformer.kt
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
- */
-
-package org.jetbrains.dokka.transformers.pages
-
-import org.jetbrains.dokka.pages.RootPageNode
-
-public fun interface PageTransformer {
- public operator fun invoke(input: RootPageNode): RootPageNode
-}
diff --git a/core/src/main/kotlin/transformers/pages/PageTransformerBuilders.kt b/core/src/main/kotlin/transformers/pages/PageTransformerBuilders.kt
deleted file mode 100644
index a00c1578..00000000
--- a/core/src/main/kotlin/transformers/pages/PageTransformerBuilders.kt
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
- */
-
-package org.jetbrains.dokka.transformers.pages
-
-import org.jetbrains.dokka.pages.PageNode
-import org.jetbrains.dokka.pages.RootPageNode
-
-public fun pageScanner(block: PageNode.() -> Unit): PageTransformer {
- return PageTransformer { input -> input.invokeOnAll(block) as RootPageNode }
-}
-
-public fun pageMapper(block: PageNode.() -> PageNode): PageTransformer {
- return PageTransformer { input -> input.alterChildren(block) as RootPageNode }
-}
-
-public fun pageStructureTransformer(block: RootPageNode.() -> RootPageNode): PageTransformer {
- return PageTransformer { input -> block(input) }
-}
-
-public fun PageNode.invokeOnAll(block: PageNode.() -> Unit): PageNode =
- this.also(block).also { it.children.forEach { it.invokeOnAll(block) } }
-
-public fun PageNode.alterChildren(block: PageNode.() -> PageNode): PageNode =
- block(this).modified(children = this.children.map { it.alterChildren(block) })
-
diff --git a/core/src/main/kotlin/transformers/sources/AsyncSourceToDocumentableTranslator.kt b/core/src/main/kotlin/transformers/sources/AsyncSourceToDocumentableTranslator.kt
deleted file mode 100644
index f7f45d25..00000000
--- a/core/src/main/kotlin/transformers/sources/AsyncSourceToDocumentableTranslator.kt
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
- */
-
-package org.jetbrains.dokka.transformers.sources
-
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.runBlocking
-import org.jetbrains.dokka.DokkaConfiguration
-import org.jetbrains.dokka.model.DModule
-import org.jetbrains.dokka.plugability.DokkaContext
-
-public interface AsyncSourceToDocumentableTranslator : SourceToDocumentableTranslator {
- public suspend fun invokeSuspending(sourceSet: DokkaConfiguration.DokkaSourceSet, context: DokkaContext): DModule
-
- override fun invoke(sourceSet: DokkaConfiguration.DokkaSourceSet, context: DokkaContext): DModule =
- runBlocking(Dispatchers.Default) {
- invokeSuspending(sourceSet, context)
- }
-}
diff --git a/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt b/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt
deleted file mode 100644
index 04f11830..00000000
--- a/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
- */
-
-package org.jetbrains.dokka.transformers.sources
-
-import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
-import org.jetbrains.dokka.model.DModule
-import org.jetbrains.dokka.plugability.DokkaContext
-
-public fun interface SourceToDocumentableTranslator {
- public fun invoke(sourceSet: DokkaSourceSet, context: DokkaContext): DModule
-}