aboutsummaryrefslogtreecommitdiff
path: root/plugins/javadoc
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-08-31 20:16:01 +0200
committerGitHub <noreply@github.com>2023-08-31 20:16:01 +0200
commit02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33 (patch)
tree66f6d6f089a93b863bf1144666491eca6729ad05 /plugins/javadoc
parent6a181a7a2b03ec263788d137610e86937a57d434 (diff)
downloaddokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.gz
dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.bz2
dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.zip
Enable explicit API mode (#3139)
Diffstat (limited to 'plugins/javadoc')
-rw-r--r--plugins/javadoc/api/javadoc.api5
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocDocumentableToPageTranslator.kt2
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt19
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPlugin.kt47
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt16
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProviderFactory.kt7
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt81
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocIndexExtra.kt4
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt108
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt17
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/JavadocContentToHtmlTranslator.kt2
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt19
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt6
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/signatures/JavadocSignatureProvider.kt10
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/transformers/documentables/JavadocDocumentableJVMSourceSetFilter.kt4
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/translators/documentables/JavadocPageContentBuilder.kt24
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/validity/MultiplatformConfiguredChecker.kt8
17 files changed, 216 insertions, 163 deletions
diff --git a/plugins/javadoc/api/javadoc.api b/plugins/javadoc/api/javadoc.api
index 32d71dfb..a6b686d7 100644
--- a/plugins/javadoc/api/javadoc.api
+++ b/plugins/javadoc/api/javadoc.api
@@ -16,14 +16,12 @@ public final class org/jetbrains/dokka/javadoc/JavadocPlugin : org/jetbrains/dok
public final fun getAllClassessPageInstaller ()Lorg/jetbrains/dokka/plugability/Extension;
public final fun getDeprecatedPageCreator ()Lorg/jetbrains/dokka/plugability/Extension;
public final fun getDocumentableSourceSetFilter ()Lorg/jetbrains/dokka/plugability/Extension;
- public final fun getDokkaBasePlugin ()Lorg/jetbrains/dokka/base/DokkaBase;
public final fun getDokkaJavadocPlugin ()Lorg/jetbrains/dokka/plugability/Extension;
public final fun getIndexGenerator ()Lorg/jetbrains/dokka/plugability/Extension;
public final fun getJavadocLocationProviderFactory ()Lorg/jetbrains/dokka/plugability/Extension;
public final fun getJavadocMultiplatformCheck ()Lorg/jetbrains/dokka/plugability/Extension;
public final fun getJavadocPreprocessors ()Lorg/jetbrains/dokka/plugability/ExtensionPoint;
public final fun getJavadocSignatureProvider ()Lorg/jetbrains/dokka/plugability/Extension;
- public final fun getKotinAsJavaPlugin ()Lorg/jetbrains/dokka/kotlinAsJava/KotlinAsJavaPlugin;
public final fun getLocationProviderFactory ()Lorg/jetbrains/dokka/plugability/ExtensionPoint;
public final fun getPackageListCreator ()Lorg/jetbrains/dokka/plugability/Extension;
public final fun getPageTranslator ()Lorg/jetbrains/dokka/plugability/Extension;
@@ -45,8 +43,7 @@ public final class org/jetbrains/dokka/javadoc/location/JavadocLocationProvider
public final class org/jetbrains/dokka/javadoc/location/JavadocLocationProviderFactory : org/jetbrains/dokka/base/resolvers/local/LocationProviderFactory {
public fun <init> (Lorg/jetbrains/dokka/plugability/DokkaContext;)V
- public synthetic fun getLocationProvider (Lorg/jetbrains/dokka/pages/RootPageNode;)Lorg/jetbrains/dokka/base/resolvers/local/LocationProvider;
- public fun getLocationProvider (Lorg/jetbrains/dokka/pages/RootPageNode;)Lorg/jetbrains/dokka/javadoc/location/JavadocLocationProvider;
+ public fun getLocationProvider (Lorg/jetbrains/dokka/pages/RootPageNode;)Lorg/jetbrains/dokka/base/resolvers/local/LocationProvider;
}
public final class org/jetbrains/dokka/javadoc/pages/AllClassesPage : org/jetbrains/dokka/javadoc/pages/JavadocPageNode {
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocDocumentableToPageTranslator.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocDocumentableToPageTranslator.kt
index 07a58c1b..595c307a 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocDocumentableToPageTranslator.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocDocumentableToPageTranslator.kt
@@ -9,7 +9,7 @@ import org.jetbrains.dokka.pages.RootPageNode
import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.transformers.documentation.DocumentableToPageTranslator
-class JavadocDocumentableToPageTranslator(
+public class JavadocDocumentableToPageTranslator(
private val context: DokkaContext
) : DocumentableToPageTranslator {
override fun invoke(module: DModule): RootPageNode = JavadocPageCreator(context).pageForModule(module)
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt
index d078b492..cfdda649 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt
@@ -20,25 +20,27 @@ import org.jetbrains.dokka.plugability.plugin
import org.jetbrains.dokka.plugability.querySingle
import kotlin.reflect.KClass
-open class JavadocPageCreator(context: DokkaContext) {
+public open class JavadocPageCreator(context: DokkaContext) {
private val signatureProvider: SignatureProvider = context.plugin<DokkaBase>().querySingle { signatureProvider }
private val documentationVersion = context.configuration.moduleVersion
- fun pageForModule(m: DModule): JavadocModulePageNode =
- JavadocModulePageNode(
+ public fun pageForModule(m: DModule): JavadocModulePageNode {
+ return JavadocModulePageNode(
name = m.name.ifEmpty { "root" },
content = contentForModule(m),
children = m.packages.map { pageForPackage(it) },
dri = setOf(m.dri),
extra = ((m as? WithExtraProperties<DModule>)?.extra ?: PropertyContainer.empty())
)
+ }
- fun pageForPackage(p: DPackage) =
- JavadocPackagePageNode(p.name, contentForPackage(p), setOf(p.dri), listOf(p),
+ public fun pageForPackage(p: DPackage): JavadocPackagePageNode {
+ return JavadocPackagePageNode(p.name, contentForPackage(p), setOf(p.dri), listOf(p),
p.classlikes.mapNotNull { pageForClasslike(it) }
)
+ }
- fun pageForClasslike(c: DClasslike): JavadocClasslikePageNode? {
+ public fun pageForClasslike(c: DClasslike): JavadocClasslikePageNode? {
return c.highestJvmSourceSet?.let { jvm ->
@Suppress("UNCHECKED_CAST")
val extra = ((c as? WithExtraProperties<Documentable>)?.extra ?: PropertyContainer.empty())
@@ -209,9 +211,10 @@ open class JavadocPageCreator(context: DokkaContext) {
)
}
- fun List<ContentNode>.nodeForJvm(jvm: DokkaSourceSet): ContentNode =
- firstOrNull { jvm.sourceSetID in it.sourceSets.computeSourceSetIds() }
+ public fun List<ContentNode>.nodeForJvm(jvm: DokkaSourceSet): ContentNode {
+ return firstOrNull { jvm.sourceSetID in it.sourceSets.computeSourceSetIds() }
?: throw IllegalStateException("No source set found for ${jvm.sourceSetID} ")
+ }
private fun Documentable.brief(sourceSet: DokkaSourceSet? = highestJvmSourceSet): List<ContentNode> =
firstSentenceBriefFromContentNodes(descriptionToContentNodes(sourceSet))
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPlugin.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPlugin.kt
index 37037101..6a5749ab 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPlugin.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPlugin.kt
@@ -8,8 +8,10 @@ import org.jetbrains.dokka.CoreExtensions
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.renderers.PackageListCreator
import org.jetbrains.dokka.base.renderers.RootCreator
+import org.jetbrains.dokka.base.resolvers.local.LocationProviderFactory
import org.jetbrains.dokka.base.resolvers.shared.PackageList.Companion.PACKAGE_LIST_NAME
import org.jetbrains.dokka.base.resolvers.shared.RecognizedLinkFormat
+import org.jetbrains.dokka.base.signatures.SignatureProvider
import org.jetbrains.dokka.javadoc.location.JavadocLocationProviderFactory
import org.jetbrains.dokka.javadoc.pages.*
import org.jetbrains.dokka.javadoc.renderer.KorteJavadocRenderer
@@ -17,49 +19,52 @@ import org.jetbrains.dokka.javadoc.signatures.JavadocSignatureProvider
import org.jetbrains.dokka.javadoc.transformers.documentables.JavadocDocumentableJVMSourceSetFilter
import org.jetbrains.dokka.javadoc.validity.MultiplatformConfiguredChecker
import org.jetbrains.dokka.kotlinAsJava.KotlinAsJavaPlugin
-import org.jetbrains.dokka.plugability.DokkaPlugin
-import org.jetbrains.dokka.plugability.DokkaPluginApiPreview
-import org.jetbrains.dokka.plugability.PluginApiPreviewAcknowledgement
+import org.jetbrains.dokka.plugability.*
import org.jetbrains.dokka.renderers.PostAction
+import org.jetbrains.dokka.renderers.Renderer
+import org.jetbrains.dokka.transformers.documentation.DocumentableToPageTranslator
+import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer
import org.jetbrains.dokka.transformers.pages.PageTransformer
+import org.jetbrains.dokka.validity.PreGenerationChecker
-class JavadocPlugin : DokkaPlugin() {
+public class JavadocPlugin : DokkaPlugin() {
- val dokkaBasePlugin by lazy { plugin<DokkaBase>() }
- val kotinAsJavaPlugin by lazy { plugin<KotlinAsJavaPlugin>() }
- val locationProviderFactory by lazy { dokkaBasePlugin.locationProviderFactory }
- val javadocPreprocessors by extensionPoint<PageTransformer>()
+ private val dokkaBasePlugin: DokkaBase by lazy { plugin<DokkaBase>() }
+ private val kotinAsJavaPlugin: KotlinAsJavaPlugin by lazy { plugin<KotlinAsJavaPlugin>() }
- val dokkaJavadocPlugin by extending {
+ public val locationProviderFactory: ExtensionPoint<LocationProviderFactory> by lazy { dokkaBasePlugin.locationProviderFactory }
+ public val javadocPreprocessors: ExtensionPoint<PageTransformer> by extensionPoint<PageTransformer>()
+
+ public val dokkaJavadocPlugin: Extension<Renderer, *, *> by extending {
CoreExtensions.renderer providing { ctx -> KorteJavadocRenderer(ctx, "views") } override dokkaBasePlugin.htmlRenderer
}
- val javadocMultiplatformCheck by extending {
+ public val javadocMultiplatformCheck: Extension<PreGenerationChecker, *, *> by extending {
CoreExtensions.preGenerationCheck providing ::MultiplatformConfiguredChecker
}
- val pageTranslator by extending {
+ public val pageTranslator: Extension<DocumentableToPageTranslator, *, *> by extending {
CoreExtensions.documentableToPageTranslator providing ::JavadocDocumentableToPageTranslator override
kotinAsJavaPlugin.kotlinAsJavaDocumentableToPageTranslator
}
- val documentableSourceSetFilter by extending {
+ public val documentableSourceSetFilter: Extension<PreMergeDocumentableTransformer, *, *> by extending {
dokkaBasePlugin.preMergeDocumentableTransformer providing ::JavadocDocumentableJVMSourceSetFilter
}
- val javadocLocationProviderFactory by extending {
+ public val javadocLocationProviderFactory: Extension<LocationProviderFactory, *, *> by extending {
dokkaBasePlugin.locationProviderFactory providing ::JavadocLocationProviderFactory override dokkaBasePlugin.locationProvider
}
- val javadocSignatureProvider by extending {
+ public val javadocSignatureProvider: Extension<SignatureProvider, *, *> by extending {
dokkaBasePlugin.signatureProvider providing ::JavadocSignatureProvider override kotinAsJavaPlugin.javaSignatureProvider
}
- val rootCreator by extending {
+ public val rootCreator: Extension<PageTransformer, *, *> by extending {
javadocPreprocessors with RootCreator
}
- val packageListCreator by extending {
+ public val packageListCreator: Extension<PageTransformer, *, *> by extending {
javadocPreprocessors providing {
PackageListCreator(
context = it,
@@ -69,23 +74,23 @@ class JavadocPlugin : DokkaPlugin() {
} order { after(rootCreator) }
}
- val resourcesInstaller by extending {
+ public val resourcesInstaller: Extension<PageTransformer, *, *> by extending {
javadocPreprocessors with ResourcesInstaller order { after(rootCreator) }
}
- val treeViewInstaller by extending {
+ public val treeViewInstaller: Extension<PageTransformer, *, *> by extending {
javadocPreprocessors providing ::TreeViewInstaller order { after(rootCreator) }
}
- val allClassessPageInstaller by extending {
+ public val allClassessPageInstaller: Extension<PageTransformer, *, *> by extending {
javadocPreprocessors with AllClassesPageInstaller order { before(rootCreator) }
}
- val indexGenerator by extending {
+ public val indexGenerator: Extension<PageTransformer, *, *> by extending {
javadocPreprocessors with IndexGenerator order { before(rootCreator) }
}
- val deprecatedPageCreator by extending {
+ public val deprecatedPageCreator: Extension<PageTransformer, *, *> by extending {
javadocPreprocessors with DeprecatedPageCreator order { before(rootCreator) }
}
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt
index 114355d3..6de4c808 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt
@@ -16,8 +16,10 @@ import org.jetbrains.dokka.pages.RootPageNode
import org.jetbrains.dokka.plugability.DokkaContext
import java.util.*
-class JavadocLocationProvider(pageRoot: RootPageNode, dokkaContext: DokkaContext) :
- DefaultLocationProvider(pageRoot, dokkaContext) {
+public class JavadocLocationProvider(
+ pageRoot: RootPageNode,
+ dokkaContext: DokkaContext
+) : DefaultLocationProvider(pageRoot, dokkaContext) {
private val pathIndex = IdentityHashMap<PageNode, List<String>>().apply {
fun registerPath(page: PageNode, prefix: List<String> = emptyList()) {
@@ -103,15 +105,16 @@ class JavadocLocationProvider(pageRoot: RootPageNode, dokkaContext: DokkaContext
})"
} ?: dri.classNames.orEmpty()
- override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean) =
- pathIndex[node]?.relativeTo(pathIndex[context].orEmpty())?.let {
+ override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String {
+ return pathIndex[node]?.relativeTo(pathIndex[context].orEmpty())?.let {
if (skipExtension) it.removeSuffix(".html") else it
} ?: run {
throw IllegalStateException("Path for ${node::class.java.canonicalName}:${node.name} not found")
}
+ }
- fun resolve(link: LinkJavadocListEntry, contextRoot: PageNode? = null, skipExtension: Boolean = true) =
- pathIndex[link.dri.first()]?.let {
+ public fun resolve(link: LinkJavadocListEntry, contextRoot: PageNode? = null, skipExtension: Boolean = true): String {
+ return pathIndex[link.dri.first()]?.let {
when (link.kind) {
JavadocContentKind.Class -> it
JavadocContentKind.OverviewSummary -> it.dropLast(1) + "index"
@@ -123,6 +126,7 @@ class JavadocLocationProvider(pageRoot: RootPageNode, dokkaContext: DokkaContext
else -> it
}
}?.relativeTo(pathIndex[contextRoot].orEmpty())?.let { if (skipExtension) "$it.html" else it }.orEmpty()
+ }
override fun pathToRoot(from: PageNode): String {
TODO("Not yet implemented")
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProviderFactory.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProviderFactory.kt
index ebc7ca27..10e7d416 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProviderFactory.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProviderFactory.kt
@@ -4,11 +4,14 @@
package org.jetbrains.dokka.javadoc.location
+import org.jetbrains.dokka.base.resolvers.local.LocationProvider
import org.jetbrains.dokka.base.resolvers.local.LocationProviderFactory
import org.jetbrains.dokka.pages.RootPageNode
import org.jetbrains.dokka.plugability.DokkaContext
-class JavadocLocationProviderFactory(private val context: DokkaContext) : LocationProviderFactory {
- override fun getLocationProvider(pageNode: RootPageNode) =
+public class JavadocLocationProviderFactory(
+ private val context: DokkaContext
+) : LocationProviderFactory {
+ override fun getLocationProvider(pageNode: RootPageNode): LocationProvider =
JavadocLocationProvider(pageNode, context)
}
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt
index 41506d1c..427ad98e 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt
@@ -9,11 +9,11 @@ import org.jetbrains.dokka.model.DisplaySourceSet
import org.jetbrains.dokka.model.properties.PropertyContainer
import org.jetbrains.dokka.pages.*
-enum class JavadocContentKind : Kind {
+public enum class JavadocContentKind : Kind {
AllClasses, OverviewSummary, PackageSummary, Class, OverviewTree, PackageTree, IndexPage
}
-abstract class JavadocContentNode(
+public abstract class JavadocContentNode(
dri: Set<DRI>,
kind: Kind,
override val sourceSets: Set<DisplaySourceSet>
@@ -24,17 +24,17 @@ abstract class JavadocContentNode(
override fun withNewExtras(newExtras: PropertyContainer<ContentNode>): ContentNode = this
}
-interface JavadocList {
- val tabTitle: String
- val colTitle: String
- val children: List<JavadocListEntry>
+public interface JavadocList {
+ public val tabTitle: String
+ public val colTitle: String
+ public val children: List<JavadocListEntry>
}
-interface JavadocListEntry {
- val stringTag: String
+public interface JavadocListEntry {
+ public val stringTag: String
}
-data class EmptyNode(
+public data class EmptyNode(
val dri: DRI,
val kind: Kind,
override val sourceSets: Set<DisplaySourceSet>,
@@ -51,15 +51,15 @@ data class EmptyNode(
override fun hasAnyContent(): Boolean = false
}
-data class JavadocContentGroup(
+public data class JavadocContentGroup(
val dri: Set<DRI>,
val kind: Kind,
override val sourceSets: Set<DisplaySourceSet>,
override val children: List<JavadocContentNode>
) : JavadocContentNode(dri, kind, sourceSets) {
- companion object {
- operator fun invoke(
+ public companion object {
+ public operator fun invoke(
dri: Set<DRI>,
kind: Kind,
sourceSets: Set<DisplaySourceSet>,
@@ -76,11 +76,13 @@ data class JavadocContentGroup(
copy(sourceSets = sourceSets)
}
-class JavaContentGroupBuilder(val sourceSets: Set<DisplaySourceSet>) {
- val list = mutableListOf<JavadocContentNode>()
+public class JavaContentGroupBuilder(
+ public val sourceSets: Set<DisplaySourceSet>
+) {
+ public val list: MutableList<JavadocContentNode> = mutableListOf<JavadocContentNode>()
}
-data class TitleNode(
+public data class TitleNode(
val title: String,
val subtitle: List<ContentNode>,
val version: String?,
@@ -97,7 +99,7 @@ data class TitleNode(
copy(sourceSets = sourceSets)
}
-fun JavaContentGroupBuilder.title(
+public fun JavaContentGroupBuilder.title(
title: String,
subtitle: List<ContentNode>,
version: String? = null,
@@ -108,7 +110,7 @@ fun JavaContentGroupBuilder.title(
list.add(TitleNode(title, subtitle, version, parent, dri, kind, sourceSets))
}
-data class RootListNode(
+public data class RootListNode(
val entries: List<LeafListNode>,
val dri: Set<DRI>,
val kind: Kind,
@@ -121,7 +123,7 @@ data class RootListNode(
copy(sourceSets = sourceSets)
}
-data class LeafListNode(
+public data class LeafListNode(
val tabTitle: String,
val colTitle: String,
val entries: List<JavadocListEntry>,
@@ -135,7 +137,7 @@ data class LeafListNode(
}
-fun JavaContentGroupBuilder.rootList(
+public fun JavaContentGroupBuilder.rootList(
dri: Set<DRI>,
kind: Kind,
rootList: List<JavadocList>
@@ -146,7 +148,7 @@ fun JavaContentGroupBuilder.rootList(
list.add(RootListNode(children, dri, kind, sourceSets))
}
-fun JavaContentGroupBuilder.leafList(
+public fun JavaContentGroupBuilder.leafList(
dri: Set<DRI>,
kind: Kind,
leafList: JavadocList
@@ -154,36 +156,41 @@ fun JavaContentGroupBuilder.leafList(
list.add(LeafListNode(leafList.tabTitle, leafList.colTitle, leafList.children, dri, kind, sourceSets))
}
-fun JavadocList(tabTitle: String, colTitle: String, children: List<JavadocListEntry>) = object : JavadocList {
- override val tabTitle = tabTitle
- override val colTitle = colTitle
- override val children = children
+public fun JavadocList(tabTitle: String, colTitle: String, children: List<JavadocListEntry>): JavadocList {
+ return object : JavadocList {
+ override val tabTitle = tabTitle
+ override val colTitle = colTitle
+ override val children = children
+ }
}
-class LinkJavadocListEntry(
- val name: String,
- val dri: Set<DRI>,
- val kind: Kind = ContentKind.Symbol,
- val sourceSets: Set<DisplaySourceSet>
-) :
- JavadocListEntry {
+public class LinkJavadocListEntry(
+ public val name: String,
+ public val dri: Set<DRI>,
+ public val kind: Kind = ContentKind.Symbol,
+ public val sourceSets: Set<DisplaySourceSet>
+) : JavadocListEntry {
override val stringTag: String
- get() = if (builtString == null)
- throw IllegalStateException("stringTag for LinkJavadocListEntry accessed before build() call")
- else builtString!!
+ get() {
+ return if (builtString == null) {
+ throw IllegalStateException("stringTag for LinkJavadocListEntry accessed before build() call")
+ } else {
+ builtString!!
+ }
+ }
private var builtString: String? = null
- fun build(body: (String, Set<DRI>, Kind, List<DisplaySourceSet>) -> String) {
+ public fun build(body: (String, Set<DRI>, Kind, List<DisplaySourceSet>) -> String) {
builtString = body(name, dri, kind, sourceSets.toList())
}
}
-data class RowJavadocListEntry(val link: LinkJavadocListEntry, val doc: List<ContentNode>) : JavadocListEntry {
+public data class RowJavadocListEntry(val link: LinkJavadocListEntry, val doc: List<ContentNode>) : JavadocListEntry {
override val stringTag: String = ""
}
-data class JavadocSignatureContentNode(
+public data class JavadocSignatureContentNode(
val dri: DRI,
val kind: Kind = ContentKind.Symbol,
val annotations: ContentNode?,
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocIndexExtra.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocIndexExtra.kt
index 217bdb9d..4ed0864a 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocIndexExtra.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocIndexExtra.kt
@@ -8,7 +8,7 @@ import org.jetbrains.dokka.model.Documentable
import org.jetbrains.dokka.model.properties.ExtraProperty
import org.jetbrains.dokka.pages.ContentNode
-data class JavadocIndexExtra(val index: List<ContentNode>) : ExtraProperty<Documentable> {
+public data class JavadocIndexExtra(val index: List<ContentNode>) : ExtraProperty<Documentable> {
override val key: ExtraProperty.Key<Documentable, *> = JavadocIndexExtra
- companion object : ExtraProperty.Key<Documentable, JavadocIndexExtra>
+ public companion object : ExtraProperty.Key<Documentable, JavadocIndexExtra>
}
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt
index aa398c0d..3b5b63cc 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocPageNodes.kt
@@ -14,22 +14,22 @@ import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.analysis.kotlin.internal.InheritanceBuilder
import org.jetbrains.dokka.analysis.kotlin.internal.InheritanceNode
-interface JavadocPageNode : ContentPage, WithDocumentables
+public interface JavadocPageNode : ContentPage, WithDocumentables
-interface WithJavadocExtra<T : Documentable> : WithExtraProperties<T> {
+public interface WithJavadocExtra<T : Documentable> : WithExtraProperties<T> {
override fun withNewExtras(newExtras: PropertyContainer<T>): T =
throw IllegalStateException("Merging extras is not applicable for javadoc")
}
-fun interface WithNavigable {
- fun getAllNavigables(): List<NavigableJavadocNode>
+public fun interface WithNavigable {
+ public fun getAllNavigables(): List<NavigableJavadocNode>
}
-interface WithBrief {
- val brief: List<ContentNode>
+public interface WithBrief {
+ public val brief: List<ContentNode>
}
-class JavadocModulePageNode(
+public class JavadocModulePageNode(
override val name: String,
override val content: JavadocContentNode,
override val children: List<PageNode>,
@@ -60,7 +60,7 @@ class JavadocModulePageNode(
override fun getDRI(): DRI = dri.first()
}
-class JavadocPackagePageNode(
+public class JavadocPackagePageNode(
override val name: String,
override val content: JavadocContentNode,
override val dri: Set<DRI>,
@@ -116,17 +116,20 @@ class JavadocPackagePageNode(
override fun getDRI(): DRI = dri.first()
}
-interface NavigableJavadocNode {
- fun getId(): String
- fun getDRI(): DRI
+public interface NavigableJavadocNode {
+ public fun getId(): String
+ public fun getDRI(): DRI
}
-sealed class AnchorableJavadocNode(open val name: String, open val dri: DRI) : NavigableJavadocNode {
+public sealed class AnchorableJavadocNode(
+ public open val name: String,
+ public open val dri: DRI
+) : NavigableJavadocNode {
override fun getId(): String = name
override fun getDRI(): DRI = dri
}
-data class JavadocEntryNode(
+public data class JavadocEntryNode(
override val dri: DRI,
override val name: String,
val signature: JavadocSignatureContentNode,
@@ -134,7 +137,7 @@ data class JavadocEntryNode(
override val extra: PropertyContainer<DEnumEntry> = PropertyContainer.empty()
) : AnchorableJavadocNode(name, dri), WithJavadocExtra<DEnumEntry>, WithBrief
-data class JavadocParameterNode(
+public data class JavadocParameterNode(
override val dri: DRI,
override val name: String,
val type: ContentNode,
@@ -143,7 +146,7 @@ data class JavadocParameterNode(
override val extra: PropertyContainer<DParameter> = PropertyContainer.empty()
) : AnchorableJavadocNode(name, dri), WithJavadocExtra<DParameter>
-data class JavadocPropertyNode(
+public data class JavadocPropertyNode(
override val dri: DRI,
override val name: String,
val signature: JavadocSignatureContentNode,
@@ -152,7 +155,7 @@ data class JavadocPropertyNode(
override val extra: PropertyContainer<DProperty> = PropertyContainer.empty()
) : AnchorableJavadocNode(name, dri), WithJavadocExtra<DProperty>, WithBrief
-data class JavadocFunctionNode(
+public data class JavadocFunctionNode(
val signature: JavadocSignatureContentNode,
override val brief: List<ContentNode>,
val description: List<ContentNode>,
@@ -174,21 +177,21 @@ data class JavadocFunctionNode(
}
}
-class JavadocClasslikePageNode(
+public class JavadocClasslikePageNode(
override val name: String,
override val content: JavadocContentNode,
override val dri: Set<DRI>,
- val signature: JavadocSignatureContentNode,
- val description: List<ContentNode>,
- val constructors: List<JavadocFunctionNode>,
- val methods: List<JavadocFunctionNode>,
- val entries: List<JavadocEntryNode>,
- val classlikes: List<JavadocClasslikePageNode>,
- val properties: List<JavadocPropertyNode>,
+ public val signature: JavadocSignatureContentNode,
+ public val description: List<ContentNode>,
+ public val constructors: List<JavadocFunctionNode>,
+ public val methods: List<JavadocFunctionNode>,
+ public val entries: List<JavadocEntryNode>,
+ public val classlikes: List<JavadocClasslikePageNode>,
+ public val properties: List<JavadocPropertyNode>,
override val brief: List<ContentNode>,
- val sinceTagContent: List<List<ContentNode>>,
- val authorTagContent: List<List<ContentNode>>,
+ public val sinceTagContent: List<List<ContentNode>>,
+ public val authorTagContent: List<List<ContentNode>>,
override val documentables: List<Documentable> = emptyList(),
override val children: List<PageNode> = emptyList(),
@@ -199,11 +202,11 @@ class JavadocClasslikePageNode(
override fun getAllNavigables(): List<NavigableJavadocNode> =
methods + entries + classlikes.map { it.getAllNavigables() }.flatten() + this
- fun getAnchorables(): List<AnchorableJavadocNode> =
+ public fun getAnchorables(): List<AnchorableJavadocNode> =
constructors + methods + entries + properties
- val kind: String? = documentables.firstOrNull()?.kind()
- val packageName = dri.first().packageName
+ public val kind: String? = documentables.firstOrNull()?.kind()
+ public val packageName: String? = dri.first().packageName
override fun getId(): String = name
override fun getDRI(): DRI = dri.first()
@@ -259,8 +262,10 @@ class JavadocClasslikePageNode(
)
}
-class AllClassesPage(val classes: List<JavadocClasslikePageNode>) : JavadocPageNode {
- val classEntries =
+public class AllClassesPage(
+ public val classes: List<JavadocClasslikePageNode>
+) : JavadocPageNode {
+ public val classEntries: List<LinkJavadocListEntry> =
classes.map { LinkJavadocListEntry(it.name, it.dri, ContentKind.Classlikes, it.sourceSets().toSet()) }
override val name: String = "All Classes"
@@ -291,8 +296,8 @@ class AllClassesPage(val classes: List<JavadocClasslikePageNode>) : JavadocPageN
}
-class DeprecatedPage(
- val elements: Map<DeprecatedPageSection, Set<DeprecatedNode>>,
+public class DeprecatedPage(
+ public val elements: Map<DeprecatedPageSection, Set<DeprecatedNode>>,
sourceSet: Set<DisplaySourceSet>
) : JavadocPageNode {
override val name: String = "deprecated"
@@ -322,14 +327,22 @@ class DeprecatedPage(
}
-class DeprecatedNode(val name: String, val address: DRI, val description: List<ContentNode>) {
+public class DeprecatedNode(
+ public val name: String,
+ public val address: DRI,
+ public val description: List<ContentNode>
+) {
override fun equals(other: Any?): Boolean =
(other as? DeprecatedNode)?.address == address
override fun hashCode(): Int = address.hashCode()
}
-enum class DeprecatedPageSection(val id: String, val caption: String, val header: String) {
+public enum class DeprecatedPageSection(
+ public val id: String,
+ public val caption: String,
+ public val header: String,
+) {
DeprecatedModules("module", "Modules", "Module"),
DeprecatedInterfaces("interface", "Interfaces", "Interface"),
DeprecatedClasses("class", "Classes", "Class"),
@@ -344,10 +357,11 @@ enum class DeprecatedPageSection(val id: String, val caption: String, val header
internal fun getPosition() = ordinal
}
-class IndexPage(
- val id: Int,
- val elements: List<NavigableJavadocNode>,
- val keys: List<Char>,
+public class IndexPage(
+ public val id: Int,
+ public val elements: List<NavigableJavadocNode>,
+ public val keys: List<Char>,
+
sourceSet: Set<DisplaySourceSet>
) : JavadocPageNode {
@@ -356,7 +370,7 @@ class IndexPage(
override val documentables: List<Documentable> = emptyList()
override val children: List<PageNode> = emptyList()
override val embeddedResources: List<String> = listOf()
- val title: String = "${keys[id - 1]}-index"
+ public val title: String = "${keys[id - 1]}-index"
override val content: ContentNode = EmptyNode(
DRI.topLevel,
@@ -379,14 +393,14 @@ class IndexPage(
}
-class TreeViewPage(
+public class TreeViewPage(
override val name: String,
- val packages: List<JavadocPackagePageNode>?,
- val classes: List<JavadocClasslikePageNode>?,
+ public val packages: List<JavadocPackagePageNode>?,
+ public val classes: List<JavadocClasslikePageNode>?,
override val dri: Set<DRI>,
override val documentables: List<Documentable> = emptyList(),
- val root: PageNode,
- val inheritanceBuilder: InheritanceBuilder
+ public val root: PageNode,
+ public val inheritanceBuilder: InheritanceBuilder
) : JavadocPageNode {
init {
assert(packages == null || classes == null)
@@ -403,12 +417,12 @@ class TreeViewPage(
override val children: List<PageNode> = emptyList()
- val title = when (documentables.firstOrNull()) {
+ public val title: String = when (documentables.firstOrNull()) {
is DPackage -> "$name Class Hierarchy"
else -> "All packages"
}
- val kind = when (documentables.firstOrNull()) {
+ public val kind: String = when (documentables.firstOrNull()) {
is DPackage -> "package"
else -> "main"
}
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt
index a9f5b4ae..f54c41fd 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt
@@ -18,7 +18,8 @@ import org.jetbrains.dokka.plugability.querySingle
import org.jetbrains.dokka.transformers.pages.PageTransformer
import org.jetbrains.dokka.analysis.kotlin.internal.InternalKotlinAnalysisPlugin
-object ResourcesInstaller : PageTransformer {
+public object ResourcesInstaller : PageTransformer {
+
override fun invoke(input: RootPageNode): RootPageNode = input.modified(
children = input.children +
RendererSpecificResourcePage(
@@ -29,7 +30,10 @@ object ResourcesInstaller : PageTransformer {
)
}
-class TreeViewInstaller(private val context: DokkaContext) : PageTransformer {
+public class TreeViewInstaller(
+ private val context: DokkaContext
+) : PageTransformer {
+
override fun invoke(input: RootPageNode): RootPageNode = install(input, input) as RootPageNode
private fun install(node: PageNode, root: RootPageNode): PageNode = when (node) {
@@ -73,7 +77,8 @@ class TreeViewInstaller(private val context: DokkaContext) : PageTransformer {
}
}
-object AllClassesPageInstaller : PageTransformer {
+public object AllClassesPageInstaller : PageTransformer {
+
override fun invoke(input: RootPageNode): RootPageNode {
val classes = (input as JavadocModulePageNode).children.filterIsInstance<JavadocPackagePageNode>().flatMap {
it.children.filterIsInstance<JavadocClasslikePageNode>()
@@ -83,7 +88,8 @@ object AllClassesPageInstaller : PageTransformer {
}
}
-object IndexGenerator : PageTransformer {
+public object IndexGenerator : PageTransformer {
+
override fun invoke(input: RootPageNode): RootPageNode {
val elements = HashMap<Char, MutableSet<NavigableJavadocNode>>()
(input as JavadocModulePageNode).children.filterIsInstance<JavadocPackagePageNode>().forEach {
@@ -125,7 +131,8 @@ object IndexGenerator : PageTransformer {
}
}
-object DeprecatedPageCreator : PageTransformer {
+public object DeprecatedPageCreator : PageTransformer {
+
override fun invoke(input: RootPageNode): RootPageNode {
val elements = HashMap<DeprecatedPageSection, MutableSet<DeprecatedNode>>().apply {
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/JavadocContentToHtmlTranslator.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/JavadocContentToHtmlTranslator.kt
index bcf16dcb..7b54488a 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/JavadocContentToHtmlTranslator.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/JavadocContentToHtmlTranslator.kt
@@ -31,7 +31,7 @@ internal class JavadocContentToHtmlTranslator(
else -> ""
}
- fun htmlForText(node: ContentText): String {
+ private fun htmlForText(node: ContentText): String {
val escapedText = node.text.htmlEscape()
return when {
node.style.contains(ContentStyle.InDocumentationAnchor) -> """<em><a id="$escapedText" class="searchTagResult">${escapedText}</a></em>"""
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt
index daa53e11..658e42ed 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt
@@ -29,10 +29,11 @@ import org.jetbrains.dokka.renderers.Renderer
import org.jetbrains.dokka.analysis.kotlin.internal.InheritanceNode
import java.time.LocalDate
-typealias TemplateMap = Map<String, Any?>
+public typealias TemplateMap = Map<String, Any?>
-class KorteJavadocRenderer(val context: DokkaContext, resourceDir: String) :
- Renderer {
+public class KorteJavadocRenderer(
+ public val context: DokkaContext, resourceDir: String
+) : Renderer {
private val outputWriter: OutputWriter = context.plugin<DokkaBase>().querySingle { outputWriter }
private lateinit var locationProvider: JavadocLocationProvider
private val registeredPreprocessors = context.plugin<JavadocPlugin>().query { javadocPreprocessors }
@@ -45,11 +46,13 @@ class KorteJavadocRenderer(val context: DokkaContext, resourceDir: String) :
JavadocContentToTemplateMapTranslator(locationProvider, context)
}
- override fun render(root: RootPageNode) = root.let { registeredPreprocessors.fold(root) { r, t -> t.invoke(r) } }.let { newRoot ->
- locationProvider = context.plugin<JavadocPlugin>().querySingle { locationProviderFactory }.getLocationProvider(newRoot) as JavadocLocationProvider
- runBlocking(Dispatchers.IO) {
- renderPage(newRoot)
- SearchScriptsCreator(locationProvider).invoke(newRoot).forEach { renderSpecificPage(it, "") }
+ override fun render(root: RootPageNode) {
+ root.let { registeredPreprocessors.fold(root) { r, t -> t.invoke(r) } }.let { newRoot ->
+ locationProvider = context.plugin<JavadocPlugin>().querySingle { locationProviderFactory }.getLocationProvider(newRoot) as JavadocLocationProvider
+ runBlocking(Dispatchers.IO) {
+ renderPage(newRoot)
+ SearchScriptsCreator(locationProvider).invoke(newRoot).forEach { renderSpecificPage(it, "") }
+ }
}
}
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt
index 2107ab2d..af91a01d 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt
@@ -15,9 +15,11 @@ import org.jetbrains.dokka.model.Documentable
import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.utilities.formatToEndWithHtml
-class SearchScriptsCreator(private val locationProvider: LocationProvider) {
+public class SearchScriptsCreator(
+ private val locationProvider: LocationProvider
+) {
- fun invoke(input: RootPageNode): List<RendererSpecificPage> {
+ public fun invoke(input: RootPageNode): List<RendererSpecificPage> {
val data = when (input) {
is JavadocModulePageNode -> processModules(listOf(input))
else -> processModules(input.children.filterIsInstance<JavadocModulePageNode>())
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/signatures/JavadocSignatureProvider.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/signatures/JavadocSignatureProvider.kt
index d0e39f8f..e3510686 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/signatures/JavadocSignatureProvider.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/signatures/JavadocSignatureProvider.kt
@@ -23,12 +23,16 @@ import org.jetbrains.dokka.plugability.plugin
import org.jetbrains.dokka.plugability.querySingle
import org.jetbrains.dokka.utilities.DokkaLogger
-class JavadocSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLogger) : SignatureProvider,
- JvmSignatureUtils by JavaSignatureUtils {
- constructor(context: DokkaContext) : this(
+public class JavadocSignatureProvider(
+ ctcc: CommentsToContentConverter,
+ logger: DokkaLogger
+) : SignatureProvider, JvmSignatureUtils by JavaSignatureUtils {
+
+ public constructor(context: DokkaContext) : this(
context.plugin<DokkaBase>().querySingle { commentsToContentConverter },
context.logger
)
+
private val contentBuilder = JavadocPageContentBuilder(ctcc, this, logger)
private val ignoredVisibilities = setOf(JavaVisibility.Default)
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/transformers/documentables/JavadocDocumentableJVMSourceSetFilter.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/transformers/documentables/JavadocDocumentableJVMSourceSetFilter.kt
index 4a6f415d..0ab5280e 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/transformers/documentables/JavadocDocumentableJVMSourceSetFilter.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/transformers/documentables/JavadocDocumentableJVMSourceSetFilter.kt
@@ -10,7 +10,9 @@ import org.jetbrains.dokka.model.DModule
import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer
-class JavadocDocumentableJVMSourceSetFilter(val context: DokkaContext) : PreMergeDocumentableTransformer {
+public class JavadocDocumentableJVMSourceSetFilter(
+ public val context: DokkaContext
+) : PreMergeDocumentableTransformer {
private val allowedSourceSets = context.configuration.sourceSets.filter { it.analysisPlatform == Platform.jvm }
.flatMap { it.getAllDependentSourceSets() }.distinct()
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/translators/documentables/JavadocPageContentBuilder.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/translators/documentables/JavadocPageContentBuilder.kt
index c622d7d1..9746376b 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/translators/documentables/JavadocPageContentBuilder.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/translators/documentables/JavadocPageContentBuilder.kt
@@ -15,13 +15,13 @@ import org.jetbrains.dokka.pages.ContentKind
import org.jetbrains.dokka.pages.ContentNode
import org.jetbrains.dokka.utilities.DokkaLogger
-class JavadocPageContentBuilder(
+public class JavadocPageContentBuilder(
commentsConverter: CommentsToContentConverter,
signatureProvider: SignatureProvider,
logger: DokkaLogger
) : PageContentBuilder(commentsConverter, signatureProvider, logger) {
- fun PageContentBuilder.DocumentableContentBuilder.javadocGroup(
+ public fun PageContentBuilder.DocumentableContentBuilder.javadocGroup(
dri: DRI = mainDRI.first(),
sourceSets: Set<DokkaConfiguration.DokkaSourceSet> = mainSourcesetData,
extra: PropertyContainer<ContentNode> = mainExtra,
@@ -34,31 +34,31 @@ class JavadocPageContentBuilder(
).apply(block).build()
}
- open inner class JavadocContentBuilder(
+ public open inner class JavadocContentBuilder(
private val mainDri: DRI,
private val mainExtra: PropertyContainer<ContentNode>,
private val mainSourceSet: Set<DokkaConfiguration.DokkaSourceSet>,
) {
- var annotations: ContentNode? = null
- var modifiers: ContentNode? = null
- var signatureWithoutModifiers: ContentNode? = null
- var supertypes: ContentNode? = null
+ public var annotations: ContentNode? = null
+ public var modifiers: ContentNode? = null
+ public var signatureWithoutModifiers: ContentNode? = null
+ public var supertypes: ContentNode? = null
- fun annotations(block: PageContentBuilder.DocumentableContentBuilder.() -> Unit) {
+ public fun annotations(block: PageContentBuilder.DocumentableContentBuilder.() -> Unit) {
val built = buildContentForBlock(block)
if(built.hasAnyContent()) annotations = built
}
- fun modifiers(block: PageContentBuilder.DocumentableContentBuilder.() -> Unit) {
+ public fun modifiers(block: PageContentBuilder.DocumentableContentBuilder.() -> Unit) {
val built = buildContentForBlock(block)
if(built.hasAnyContent()) modifiers = built
}
- fun signatureWithoutModifiers(block: PageContentBuilder.DocumentableContentBuilder.() -> Unit) {
+ public fun signatureWithoutModifiers(block: PageContentBuilder.DocumentableContentBuilder.() -> Unit) {
signatureWithoutModifiers = buildContentForBlock(block)
}
- fun supertypes(block: PageContentBuilder.DocumentableContentBuilder.() -> Unit) {
+ public fun supertypes(block: PageContentBuilder.DocumentableContentBuilder.() -> Unit) {
val built = buildContentForBlock(block)
if(built.hasAnyContent()) supertypes = built
}
@@ -72,7 +72,7 @@ class JavadocPageContentBuilder(
block = block
)
- fun build(): JavadocSignatureContentNode = JavadocSignatureContentNode(
+ public fun build(): JavadocSignatureContentNode = JavadocSignatureContentNode(
dri = mainDri,
annotations = annotations,
modifiers = modifiers,
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/validity/MultiplatformConfiguredChecker.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/validity/MultiplatformConfiguredChecker.kt
index 8b84e39a..7ecd6757 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/validity/MultiplatformConfiguredChecker.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/validity/MultiplatformConfiguredChecker.kt
@@ -9,7 +9,9 @@ import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.validity.PreGenerationChecker
import org.jetbrains.dokka.validity.PreGenerationCheckerOutput
-class MultiplatformConfiguredChecker(val context: DokkaContext) : PreGenerationChecker {
+public class MultiplatformConfiguredChecker(
+ public val context: DokkaContext
+) : PreGenerationChecker {
override fun invoke(): PreGenerationCheckerOutput {
val isSinglePlatform = context.configuration.sourceSets.all { sourceSet ->
@@ -19,8 +21,8 @@ class MultiplatformConfiguredChecker(val context: DokkaContext) : PreGenerationC
return PreGenerationCheckerOutput(isSinglePlatform, listOfNotNull(errorMessage.takeUnless { isSinglePlatform }))
}
- companion object {
- const val errorMessage =
+ public companion object {
+ public const val errorMessage: String =
"Dokka Javadoc plugin currently does not support generating documentation for multiplatform project. Please, adjust your configuration"
}
}