diff options
Diffstat (limited to 'plugins/base/src/main/kotlin/transformers/pages')
11 files changed, 37 insertions, 21 deletions
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, |