diff options
Diffstat (limited to 'plugins/base/src/main/kotlin/transformers')
27 files changed, 112 insertions, 68 deletions
diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ActualTypealiasAdder.kt b/plugins/base/src/main/kotlin/transformers/documentables/ActualTypealiasAdder.kt index f144979a..dde1a2af 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/ActualTypealiasAdder.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/ActualTypealiasAdder.kt @@ -17,10 +17,14 @@ import org.jetbrains.dokka.transformers.documentation.DocumentableTransformer * The transformer should be applied after merging all documentables */ // TODO assign actual [DTypeAlias.expectPresentInSet] an expect source set, currently, [DTypeAlias.expectPresentInSet] always = null -class ActualTypealiasAdder : DocumentableTransformer { +public class ActualTypealiasAdder : DocumentableTransformer { - override fun invoke(original: DModule, context: DokkaContext) = original.generateTypealiasesMap().let { aliases -> - original.copy(packages = original.packages.map { it.copy(classlikes = addActualTypeAliasToClasslikes(it.classlikes, aliases)) }) + override fun invoke(original: DModule, context: DokkaContext): DModule { + return original.generateTypealiasesMap().let { aliases -> + original.copy(packages = original.packages.map { + it.copy(classlikes = addActualTypeAliasToClasslikes(it.classlikes, aliases)) + }) + } } private fun DModule.generateTypealiasesMap(): Map<DRI, DTypeAlias> = diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt index 933b713a..ec53df78 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt @@ -274,8 +274,8 @@ internal class DefaultDocumentableMerger(val context: DokkaContext) : Documentab ).mergeExtras(this, other) } -data class ClashingDriIdentifier(val value: Set<DokkaConfiguration.DokkaSourceSet>) : ExtraProperty<Documentable> { - companion object : ExtraProperty.Key<Documentable, ClashingDriIdentifier> { +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 diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DeprecatedDocumentableFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/DeprecatedDocumentableFilterTransformer.kt index e6f96240..4905e876 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DeprecatedDocumentableFilterTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DeprecatedDocumentableFilterTransformer.kt @@ -22,8 +22,9 @@ import org.jetbrains.dokka.transformers.documentation.sourceSet * Documentables with [kotlin.Deprecated.level] set to [DeprecationLevel.HIDDEN] * are suppressed regardless of global and package options. */ -class DeprecatedDocumentableFilterTransformer(context: DokkaContext) : - SuppressedByConditionDocumentableFilterTransformer(context) { +public class DeprecatedDocumentableFilterTransformer( + context: DokkaContext +) : SuppressedByConditionDocumentableFilterTransformer(context) { override fun shouldBeSuppressed(d: Documentable): Boolean { val annotations = (d as? WithExtraProperties<*>)?.annotations() ?: return false diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DocumentableReplacerTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/DocumentableReplacerTransformer.kt index eae477d5..10b25a20 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DocumentableReplacerTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DocumentableReplacerTransformer.kt @@ -8,8 +8,9 @@ import org.jetbrains.dokka.model.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer -abstract class DocumentableReplacerTransformer(val context: DokkaContext) : - PreMergeDocumentableTransformer { +public abstract class DocumentableReplacerTransformer( + public val context: DokkaContext +) : PreMergeDocumentableTransformer { override fun invoke(modules: List<DModule>): List<DModule> = modules.map { module -> val (documentable, wasChanged) = processModule(module) @@ -170,10 +171,12 @@ abstract class DocumentableReplacerTransformer(val context: DokkaContext) : )).let { AnyWithChanges(it, wasChanged) } } - protected open fun processBound(bound: Bound) = when(bound) { - is GenericTypeConstructor -> processGenericTypeConstructor(bound) - is FunctionalTypeConstructor -> processFunctionalTypeConstructor(bound) - else -> AnyWithChanges(bound, false) + protected open fun processBound(bound: Bound): AnyWithChanges<Bound> { + return when(bound) { + is GenericTypeConstructor -> processGenericTypeConstructor(bound) + is FunctionalTypeConstructor -> processFunctionalTypeConstructor(bound) + else -> AnyWithChanges(bound, false) + } } protected open fun processVariance(variance: Variance<*>): AnyWithChanges<Variance<*>> { @@ -198,7 +201,9 @@ abstract class DocumentableReplacerTransformer(val context: DokkaContext) : else -> AnyWithChanges(projection, false) } - protected open fun processGenericTypeConstructor(genericTypeConstructor: GenericTypeConstructor): AnyWithChanges<GenericTypeConstructor> { + protected open fun processGenericTypeConstructor( + genericTypeConstructor: GenericTypeConstructor + ): AnyWithChanges<GenericTypeConstructor> { val projections = genericTypeConstructor.projections.map { processProjection(it) } val wasChanged = projections.any { it.changed } @@ -207,7 +212,9 @@ abstract class DocumentableReplacerTransformer(val context: DokkaContext) : )).let { AnyWithChanges(it, wasChanged) } } - protected open fun processFunctionalTypeConstructor(functionalTypeConstructor: FunctionalTypeConstructor): AnyWithChanges<FunctionalTypeConstructor> { + protected open fun processFunctionalTypeConstructor( + functionalTypeConstructor: FunctionalTypeConstructor + ): AnyWithChanges<FunctionalTypeConstructor> { val projections = functionalTypeConstructor.projections.map { processProjection(it) } val wasChanged = projections.any { it.changed } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilterTransformer.kt index e7d3c10d..6155a71f 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilterTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilterTransformer.kt @@ -11,12 +11,16 @@ import org.jetbrains.dokka.model.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer -class DocumentableVisibilityFilterTransformer(val context: DokkaContext) : PreMergeDocumentableTransformer { +public class DocumentableVisibilityFilterTransformer( + public val context: DokkaContext +) : PreMergeDocumentableTransformer { - override fun invoke(modules: List<DModule>) = modules.map { original -> - val sourceSet = original.sourceSets.single() - val packageOptions = sourceSet.perPackageOptions - DocumentableVisibilityFilter(packageOptions, sourceSet).processModule(original) + override fun invoke(modules: List<DModule>): List<DModule> { + return modules.map { original -> + val sourceSet = original.sourceSets.single() + val packageOptions = sourceSet.perPackageOptions + DocumentableVisibilityFilter(packageOptions, sourceSet).processModule(original) + } } private class DocumentableVisibilityFilter( diff --git a/plugins/base/src/main/kotlin/transformers/documentables/EmptyModulesFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/EmptyModulesFilterTransformer.kt index 0824db7e..7a2387dc 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/EmptyModulesFilterTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/EmptyModulesFilterTransformer.kt @@ -7,7 +7,7 @@ package org.jetbrains.dokka.base.transformers.documentables import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer -class EmptyModulesFilterTransformer : PreMergeDocumentableTransformer { +public class EmptyModulesFilterTransformer : PreMergeDocumentableTransformer { override fun invoke(modules: List<DModule>): List<DModule> { return modules.filter { it.children.isNotEmpty() } } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt index fc5a622d..30ac8f70 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/EmptyPackagesFilterTransformer.kt @@ -9,7 +9,9 @@ import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer import org.jetbrains.dokka.transformers.documentation.sourceSet -class EmptyPackagesFilterTransformer(val context: DokkaContext) : PreMergeDocumentableTransformer { +public class EmptyPackagesFilterTransformer( + public val context: DokkaContext +) : PreMergeDocumentableTransformer { override fun invoke(modules: List<DModule>): List<DModule> { return modules.mapNotNull(::filterModule) } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ExtensionExtractorTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/ExtensionExtractorTransformer.kt index 79531dfb..e6102622 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/ExtensionExtractorTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/ExtensionExtractorTransformer.kt @@ -20,8 +20,7 @@ import org.jetbrains.dokka.utilities.parallelForEach import org.jetbrains.dokka.utilities.parallelMap import org.jetbrains.dokka.analysis.kotlin.internal.InternalKotlinAnalysisPlugin - -class ExtensionExtractorTransformer : DocumentableTransformer { +public class ExtensionExtractorTransformer : DocumentableTransformer { override fun invoke(original: DModule, context: DokkaContext): DModule = runBlocking(Dispatchers.Default) { val classGraph = async { if (!context.configuration.suppressInheritedMembers) @@ -151,11 +150,11 @@ class ExtensionExtractorTransformer : DocumentableTransformer { groupBy(Pair<T, *>::first, Pair<*, U>::second) } -data class CallableExtensions(val extensions: Set<Callable>) : ExtraProperty<Documentable> { - companion object Key : ExtraProperty.Key<Documentable, CallableExtensions> { - override fun mergeStrategyFor(left: CallableExtensions, right: CallableExtensions) = +public data class CallableExtensions(val extensions: Set<Callable>) : ExtraProperty<Documentable> { + public companion object Key : ExtraProperty.Key<Documentable, CallableExtensions> { + override fun mergeStrategyFor(left: CallableExtensions, right: CallableExtensions): MergeStrategy<Documentable> = MergeStrategy.Replace(CallableExtensions(left.extensions + right.extensions)) } - override val key = Key + override val key: Key = Key } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/InheritedEntriesDocumentableFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/InheritedEntriesDocumentableFilterTransformer.kt index 85457571..d9b7053a 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/InheritedEntriesDocumentableFilterTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/InheritedEntriesDocumentableFilterTransformer.kt @@ -9,8 +9,9 @@ import org.jetbrains.dokka.model.InheritedMember import org.jetbrains.dokka.model.properties.WithExtraProperties import org.jetbrains.dokka.plugability.DokkaContext -class InheritedEntriesDocumentableFilterTransformer(context: DokkaContext) : - SuppressedByConditionDocumentableFilterTransformer(context) { +public class InheritedEntriesDocumentableFilterTransformer( + context: DokkaContext +) : SuppressedByConditionDocumentableFilterTransformer(context) { override fun shouldBeSuppressed(d: Documentable): Boolean { @Suppress("UNCHECKED_CAST") diff --git a/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt index dd660289..2c7d6b89 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt @@ -12,7 +12,7 @@ import org.jetbrains.dokka.model.properties.MergeStrategy import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.DocumentableTransformer -class InheritorsExtractorTransformer : DocumentableTransformer { +public class InheritorsExtractorTransformer : DocumentableTransformer { override fun invoke(original: DModule, context: DokkaContext): DModule = original.generateInheritanceMap().let { inheritanceMap -> original.appendInheritors(inheritanceMap) as DModule } @@ -72,8 +72,10 @@ class InheritorsExtractorTransformer : DocumentableTransformer { } -class InheritorsInfo(val value: SourceSetDependent<List<DRI>>) : ExtraProperty<Documentable> { - companion object : ExtraProperty.Key<Documentable, InheritorsInfo> { +public class InheritorsInfo( + public val value: SourceSetDependent<List<DRI>> +) : ExtraProperty<Documentable> { + public companion object : ExtraProperty.Key<Documentable, InheritorsInfo> { override fun mergeStrategyFor(left: InheritorsInfo, right: InheritorsInfo): MergeStrategy<Documentable> = MergeStrategy.Replace( InheritorsInfo( diff --git a/plugins/base/src/main/kotlin/transformers/documentables/KotlinArrayDocumentableReplacerTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/KotlinArrayDocumentableReplacerTransformer.kt index 81504275..7a360cb8 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/KotlinArrayDocumentableReplacerTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/KotlinArrayDocumentableReplacerTransformer.kt @@ -9,8 +9,9 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.* import org.jetbrains.dokka.plugability.DokkaContext -class KotlinArrayDocumentableReplacerTransformer(context: DokkaContext): - DocumentableReplacerTransformer(context) { +public class KotlinArrayDocumentableReplacerTransformer( + context: DokkaContext +): DocumentableReplacerTransformer(context) { private fun Documentable.isJVM() = sourceSets.any{ it.analysisPlatform == Platform.jvm } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ObviousFunctionsDocumentableFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/ObviousFunctionsDocumentableFilterTransformer.kt index 725be0d8..09c6ac87 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/ObviousFunctionsDocumentableFilterTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/ObviousFunctionsDocumentableFilterTransformer.kt @@ -9,7 +9,9 @@ import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.ObviousMember import org.jetbrains.dokka.plugability.DokkaContext -class ObviousFunctionsDocumentableFilterTransformer(context: DokkaContext) : SuppressedByConditionDocumentableFilterTransformer(context) { +public class ObviousFunctionsDocumentableFilterTransformer( + context: DokkaContext +) : SuppressedByConditionDocumentableFilterTransformer(context) { override fun shouldBeSuppressed(d: Documentable): Boolean = context.configuration.suppressObviousFunctions && d is DFunction && d.extra[ObviousMember] != null } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/SuppressTagDocumentableFilter.kt b/plugins/base/src/main/kotlin/transformers/documentables/SuppressTagDocumentableFilter.kt index 74069f99..1dbf1262 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/SuppressTagDocumentableFilter.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/SuppressTagDocumentableFilter.kt @@ -9,8 +9,9 @@ import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.model.doc.Suppress import org.jetbrains.dokka.plugability.DokkaContext -class SuppressTagDocumentableFilter(val dokkaContext: DokkaContext) : - SuppressedByConditionDocumentableFilterTransformer(dokkaContext) { +public class SuppressTagDocumentableFilter( + public val dokkaContext: DokkaContext +) : SuppressedByConditionDocumentableFilterTransformer(dokkaContext) { override fun shouldBeSuppressed(d: Documentable): Boolean = d.documentation.any { (_, docs) -> docs.dfs { it is Suppress } != null } } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/SuppressedByConditionDocumentableFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/SuppressedByConditionDocumentableFilterTransformer.kt index a3bcad3c..4631cece 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/SuppressedByConditionDocumentableFilterTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/SuppressedByConditionDocumentableFilterTransformer.kt @@ -8,15 +8,16 @@ import org.jetbrains.dokka.model.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer -abstract class SuppressedByConditionDocumentableFilterTransformer(val context: DokkaContext) : - PreMergeDocumentableTransformer { +public abstract class SuppressedByConditionDocumentableFilterTransformer( + public val context: DokkaContext +) : PreMergeDocumentableTransformer { override fun invoke(modules: List<DModule>): List<DModule> = modules.map { module -> val (documentable, wasChanged) = processModule(module) documentable.takeIf { wasChanged } ?: module } - abstract fun shouldBeSuppressed(d: Documentable): Boolean + public abstract fun shouldBeSuppressed(d: Documentable): Boolean private fun processModule(module: DModule): DocumentableWithChanges<DModule> { val afterProcessing = module.packages.map { processPackage(it) } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/SuppressedByConfigurationDocumentableFilterTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/SuppressedByConfigurationDocumentableFilterTransformer.kt index 470cfcc7..3195f88d 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/SuppressedByConfigurationDocumentableFilterTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/SuppressedByConfigurationDocumentableFilterTransformer.kt @@ -12,7 +12,9 @@ import org.jetbrains.dokka.transformers.documentation.source import org.jetbrains.dokka.transformers.documentation.sourceSet import java.io.File -class SuppressedByConfigurationDocumentableFilterTransformer(val context: DokkaContext) : PreMergeDocumentableTransformer { +public class SuppressedByConfigurationDocumentableFilterTransformer( + public val context: DokkaContext +) : PreMergeDocumentableTransformer { override fun invoke(modules: List<DModule>): List<DModule> { return modules.mapNotNull(::filterModule) } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/utils.kt b/plugins/base/src/main/kotlin/transformers/documentables/utils.kt index 8f89dfe7..60a6396a 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/utils.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/utils.kt @@ -9,11 +9,11 @@ import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.ExceptionInSupertypes import org.jetbrains.dokka.model.properties.WithExtraProperties -val <T : Documentable> WithExtraProperties<T>.isException: Boolean +public val <T : Documentable> WithExtraProperties<T>.isException: Boolean get() = extra[ExceptionInSupertypes] != null -val <T : Documentable> WithExtraProperties<T>.deprecatedAnnotation +public val <T : Documentable> WithExtraProperties<T>.deprecatedAnnotation: Annotations.Annotation? get() = extra[Annotations]?.let { annotations -> annotations.directAnnotations.values.flatten().firstOrNull { it.isDeprecated() @@ -24,11 +24,12 @@ val <T : Documentable> WithExtraProperties<T>.deprecatedAnnotation * @return true if [T] has [kotlin.Deprecated] or [java.lang.Deprecated] * annotation for **any** source set */ -fun <T : Documentable> WithExtraProperties<T>.isDeprecated() = deprecatedAnnotation != null +public fun <T : Documentable> WithExtraProperties<T>.isDeprecated(): Boolean = deprecatedAnnotation != null /** * @return true for [kotlin.Deprecated] and [java.lang.Deprecated] */ -fun Annotations.Annotation.isDeprecated() = - (this.dri.packageName == "kotlin" && this.dri.classNames == "Deprecated") || +public fun Annotations.Annotation.isDeprecated(): Boolean { + return (this.dri.packageName == "kotlin" && this.dri.classNames == "Deprecated") || (this.dri.packageName == "java.lang" && this.dri.classNames == "Deprecated") +} diff --git a/plugins/base/src/main/kotlin/transformers/pages/annotations/SinceKotlinTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/annotations/SinceKotlinTransformer.kt index 4ef02ffd..9ff5960d 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/annotations/SinceKotlinTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/annotations/SinceKotlinTransformer.kt @@ -18,7 +18,7 @@ import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.DocumentableTransformer import org.jetbrains.dokka.utilities.associateWithNotNull -class SinceKotlinVersion constructor(str: String) : Comparable<SinceKotlinVersion> { +public class SinceKotlinVersion(str: String) : Comparable<SinceKotlinVersion> { private val parts: List<Int> = str.split(".").map { it.toInt() } /** @@ -39,7 +39,9 @@ class SinceKotlinVersion constructor(str: String) : Comparable<SinceKotlinVersio override fun toString(): String = parts.joinToString(".") } -class SinceKotlinTransformer(val context: DokkaContext) : DocumentableTransformer { +public class SinceKotlinTransformer( + public val context: DokkaContext +) : DocumentableTransformer { private val minSinceKotlinVersionOfPlatform = mapOf( Platform.common to SinceKotlinVersion("1.0"), @@ -49,7 +51,7 @@ class SinceKotlinTransformer(val context: DokkaContext) : DocumentableTransforme Platform.wasm to SinceKotlinVersion("1.8"), ) - override fun invoke(original: DModule, context: DokkaContext) = original.transform() as DModule + override fun invoke(original: DModule, context: DokkaContext): DModule = original.transform() as DModule private fun <T : Documentable> T.transform(parent: SourceSetDependent<SinceKotlinVersion>? = null): Documentable { val versions = calculateVersions(parent) diff --git a/plugins/base/src/main/kotlin/transformers/pages/comments/CommentsToContentConverter.kt b/plugins/base/src/main/kotlin/transformers/pages/comments/CommentsToContentConverter.kt index f57da595..6ca3f8d0 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/comments/CommentsToContentConverter.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/comments/CommentsToContentConverter.kt @@ -11,8 +11,8 @@ import org.jetbrains.dokka.pages.ContentNode import org.jetbrains.dokka.pages.DCI import org.jetbrains.dokka.pages.Style -interface CommentsToContentConverter { - fun buildContent( +public interface CommentsToContentConverter { + public fun buildContent( docTag: DocTag, dci: DCI, sourceSets: Set<DokkaSourceSet>, 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 dde51cb9..e4e0f53f 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt @@ -14,7 +14,7 @@ import org.jetbrains.dokka.model.toDisplaySourceSets import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.utilities.firstIsInstanceOrNull -open class DocTagToContentConverter : CommentsToContentConverter { +public open class DocTagToContentConverter : CommentsToContentConverter { override fun buildContent( docTag: DocTag, dci: DCI, diff --git a/plugins/base/src/main/kotlin/transformers/pages/merger/FallbackPageMergerStrategy.kt b/plugins/base/src/main/kotlin/transformers/pages/merger/FallbackPageMergerStrategy.kt index 4ebe7ae0..80886cc5 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/merger/FallbackPageMergerStrategy.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/merger/FallbackPageMergerStrategy.kt @@ -8,7 +8,9 @@ import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.utilities.DokkaLogger -class FallbackPageMergerStrategy(private val logger: DokkaLogger) : PageMergerStrategy { +public class FallbackPageMergerStrategy( + private val logger: DokkaLogger +) : PageMergerStrategy { override fun tryMerge(pages: List<PageNode>, path: List<String>): List<PageNode> { pages.map { (it as? ContentPage) diff --git a/plugins/base/src/main/kotlin/transformers/pages/merger/PageMerger.kt b/plugins/base/src/main/kotlin/transformers/pages/merger/PageMerger.kt index 26d97a47..e52c233c 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/merger/PageMerger.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/merger/PageMerger.kt @@ -12,7 +12,7 @@ import org.jetbrains.dokka.plugability.plugin import org.jetbrains.dokka.plugability.query import org.jetbrains.dokka.transformers.pages.PageTransformer -class PageMerger(context: DokkaContext) : PageTransformer { +public class PageMerger(context: DokkaContext) : PageTransformer { private val strategies: Iterable<PageMergerStrategy> = context.plugin<DokkaBase>().query { pageMergerStrategy } diff --git a/plugins/base/src/main/kotlin/transformers/pages/merger/PageMergerStrategy.kt b/plugins/base/src/main/kotlin/transformers/pages/merger/PageMergerStrategy.kt index e9fcc5bf..ea1b1f03 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/merger/PageMergerStrategy.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/merger/PageMergerStrategy.kt @@ -6,8 +6,8 @@ package org.jetbrains.dokka.base.transformers.pages.merger import org.jetbrains.dokka.pages.PageNode -fun interface PageMergerStrategy { +public fun interface PageMergerStrategy { - fun tryMerge(pages: List<PageNode>, path: List<String>): List<PageNode> + public fun tryMerge(pages: List<PageNode>, path: List<String>): List<PageNode> } diff --git a/plugins/base/src/main/kotlin/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt b/plugins/base/src/main/kotlin/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt index c58dc345..864545e6 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt @@ -17,7 +17,9 @@ import org.jetbrains.dokka.utilities.DokkaLogger * Merges [MemberPage] elements that have the same name. * That includes **both** properties and functions. */ -class SameMethodNamePageMergerStrategy(val logger: DokkaLogger) : PageMergerStrategy { +public class SameMethodNamePageMergerStrategy( + public val logger: DokkaLogger +) : PageMergerStrategy { override fun tryMerge(pages: List<PageNode>, path: List<String>): List<PageNode> { val members = pages .filterIsInstance<MemberPageNode>() 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 3e16987e..8d52a39d 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/merger/SourceSetMergingPageTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/merger/SourceSetMergingPageTransformer.kt @@ -13,7 +13,7 @@ import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.pages.PageTransformer -class SourceSetMergingPageTransformer(context: DokkaContext) : PageTransformer { +public class SourceSetMergingPageTransformer(context: DokkaContext) : PageTransformer { private val mergedSourceSets = context.configuration.sourceSets.toDisplaySourceSets() .associateBy { sourceSet -> sourceSet.key } 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 cfb82ed2..80eeca7e 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt @@ -17,7 +17,9 @@ import org.jetbrains.dokka.plugability.querySingle import org.jetbrains.dokka.transformers.pages.PageTransformer import java.io.File -class SourceLinksTransformer(val context: DokkaContext) : PageTransformer { +public class SourceLinksTransformer( + public val context: DokkaContext +) : PageTransformer { private val builder : PageContentBuilder = PageContentBuilder( context.plugin<DokkaBase>().querySingle { commentsToContentConverter }, @@ -120,8 +122,16 @@ class SourceLinksTransformer(val context: DokkaContext) : PageTransformer { } } -data class SourceLink(val path: String, val url: String, val lineSuffix: String?, val sourceSetData: DokkaSourceSet) { - constructor(sourceLinkDefinition: DokkaConfiguration.SourceLinkDefinition, sourceSetData: DokkaSourceSet) : this( +public data class SourceLink( + val path: String, + val url: String, + val lineSuffix: String?, + val sourceSetData: DokkaSourceSet +) { + public constructor( + sourceLinkDefinition: DokkaConfiguration.SourceLinkDefinition, + sourceSetData: DokkaSourceSet + ) : this( sourceLinkDefinition.localDirectory, sourceLinkDefinition.remoteUrl.toExternalForm(), sourceLinkDefinition.remoteLineSuffix, diff --git a/plugins/base/src/main/kotlin/transformers/pages/tags/CustomTagContentProvider.kt b/plugins/base/src/main/kotlin/transformers/pages/tags/CustomTagContentProvider.kt index 6baa0c15..fcec234f 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/tags/CustomTagContentProvider.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/tags/CustomTagContentProvider.kt @@ -23,21 +23,21 @@ import org.jetbrains.dokka.model.doc.DocTag * Using this provider, we can map custom tags (such as `@usesMathJax`) and generate content for it that * will be displayed on the pages. */ -interface CustomTagContentProvider { +public interface CustomTagContentProvider { /** * Whether this content provider supports given [CustomTagWrapper]. * * Tags can be filtered out either by name or by nested [DocTag] type */ - fun isApplicable(customTag: CustomTagWrapper): Boolean + public fun isApplicable(customTag: CustomTagWrapper): Boolean /** * Full blown content description, most likely to be on a separate page * dedicated to just one element (i.e one class/function), so any * amount of detail should be fine. */ - fun DocumentableContentBuilder.contentForDescription( + public fun DocumentableContentBuilder.contentForDescription( sourceSet: DokkaSourceSet, customTag: CustomTagWrapper ) {} @@ -56,7 +56,7 @@ interface CustomTagContentProvider { * sense to include `@usesMathjax` here, as this information seems * to be more specific and detailed than is needed for a brief. */ - fun DocumentableContentBuilder.contentForBrief( + public fun DocumentableContentBuilder.contentForBrief( sourceSet: DokkaSourceSet, customTag: CustomTagWrapper ) {} diff --git a/plugins/base/src/main/kotlin/transformers/pages/tags/SinceKotlinTagContentProvider.kt b/plugins/base/src/main/kotlin/transformers/pages/tags/SinceKotlinTagContentProvider.kt index e7e3ec0c..7c35f719 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/tags/SinceKotlinTagContentProvider.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/tags/SinceKotlinTagContentProvider.kt @@ -10,11 +10,11 @@ import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder.Doc import org.jetbrains.dokka.model.doc.CustomTagWrapper import org.jetbrains.dokka.pages.TextStyle -object SinceKotlinTagContentProvider : CustomTagContentProvider { +public object SinceKotlinTagContentProvider : CustomTagContentProvider { private const val SINCE_KOTLIN_TAG_NAME = "Since Kotlin" - override fun isApplicable(customTag: CustomTagWrapper) = customTag.name == SINCE_KOTLIN_TAG_NAME + override fun isApplicable(customTag: CustomTagWrapper): Boolean = customTag.name == SINCE_KOTLIN_TAG_NAME override fun DocumentableContentBuilder.contentForDescription( sourceSet: DokkaConfiguration.DokkaSourceSet, |