diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-08-31 20:16:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-31 20:16:01 +0200 |
commit | 02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33 (patch) | |
tree | 66f6d6f089a93b863bf1144666491eca6729ad05 /plugins/base/src/main/kotlin/resolvers/external/javadoc | |
parent | 6a181a7a2b03ec263788d137610e86937a57d434 (diff) | |
download | dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.gz dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.bz2 dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.zip |
Enable explicit API mode (#3139)
Diffstat (limited to 'plugins/base/src/main/kotlin/resolvers/external/javadoc')
3 files changed, 35 insertions, 30 deletions
diff --git a/plugins/base/src/main/kotlin/resolvers/external/javadoc/AndroidExternalLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/external/javadoc/AndroidExternalLocationProvider.kt index e90adf6f..8c18be0c 100644 --- a/plugins/base/src/main/kotlin/resolvers/external/javadoc/AndroidExternalLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/external/javadoc/AndroidExternalLocationProvider.kt @@ -8,11 +8,11 @@ import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation import org.jetbrains.dokka.links.Callable import org.jetbrains.dokka.plugability.DokkaContext -open class AndroidExternalLocationProvider( +public open class AndroidExternalLocationProvider( externalDocumentation: ExternalDocumentation, dokkaContext: DokkaContext ) : JavadocExternalLocationProvider(externalDocumentation, "", "", dokkaContext) { - override fun anchorPart(callable: Callable) = callable.name.toLowerCase() + override fun anchorPart(callable: Callable): String = callable.name.toLowerCase() } diff --git a/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProvider.kt index d7351556..65ee0e02 100644 --- a/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProvider.kt @@ -13,10 +13,10 @@ import org.jetbrains.dokka.links.EnumEntryDRIExtra import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.utilities.htmlEscape -open class JavadocExternalLocationProvider( +public open class JavadocExternalLocationProvider( externalDocumentation: ExternalDocumentation, - val brackets: String, - val separator: String, + public val brackets: String, + public val separator: String, dokkaContext: DokkaContext ) : DefaultExternalLocationProvider(externalDocumentation, ".html", dokkaContext) { @@ -53,9 +53,10 @@ open class JavadocExternalLocationProvider( return ("$docWithModule$classLink#" + anchorPart(callableChecked)).htmlEscape() } - protected open fun anchorPart(callable: Callable) = callable.name + - "${brackets.first()}" + - callable.params.joinToString(separator) + - "${brackets.last()}" - + protected open fun anchorPart(callable: Callable): String { + return callable.name + + "${brackets.first()}" + + callable.params.joinToString(separator) + + "${brackets.last()}" + } } diff --git a/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProviderFactory.kt b/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProviderFactory.kt index 6b94a75b..dc184e49 100644 --- a/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProviderFactory.kt +++ b/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProviderFactory.kt @@ -12,24 +12,28 @@ import org.jetbrains.dokka.base.resolvers.external.ExternalLocationProviderFacto import org.jetbrains.dokka.base.resolvers.shared.RecognizedLinkFormat import org.jetbrains.dokka.plugability.DokkaContext -class JavadocExternalLocationProviderFactory(val context: DokkaContext) : - ExternalLocationProviderFactory by ExternalLocationProviderFactoryWithCache( - { doc -> - when (doc.packageList.url) { - DokkaConfiguration.ExternalDocumentationLink.androidX().packageListUrl, - DokkaConfiguration.ExternalDocumentationLink.androidSdk().packageListUrl -> - AndroidExternalLocationProvider(doc, context) - else -> - when (doc.packageList.linkFormat) { - RecognizedLinkFormat.Javadoc1 -> - JavadocExternalLocationProvider(doc, "()", ", ", context) // Covers JDK 1 - 7 - RecognizedLinkFormat.Javadoc8 -> - JavadocExternalLocationProvider(doc, "--", "-", context) // Covers JDK 8 - 9 - RecognizedLinkFormat.Javadoc10, - RecognizedLinkFormat.DokkaJavadoc -> - JavadocExternalLocationProvider(doc, "()", ",", context) // Covers JDK 10 - else -> null - } - } +public class JavadocExternalLocationProviderFactory( + public val context: DokkaContext, +) : ExternalLocationProviderFactory by ExternalLocationProviderFactoryWithCache( + { doc -> + when (doc.packageList.url) { + DokkaConfiguration.ExternalDocumentationLink.androidX().packageListUrl, + DokkaConfiguration.ExternalDocumentationLink.androidSdk().packageListUrl, + -> + AndroidExternalLocationProvider(doc, context) + + else -> + when (doc.packageList.linkFormat) { + RecognizedLinkFormat.Javadoc1 -> + JavadocExternalLocationProvider(doc, "()", ", ", context) // Covers JDK 1 - 7 + RecognizedLinkFormat.Javadoc8 -> + JavadocExternalLocationProvider(doc, "--", "-", context) // Covers JDK 8 - 9 + RecognizedLinkFormat.Javadoc10, + RecognizedLinkFormat.DokkaJavadoc, + -> + JavadocExternalLocationProvider(doc, "()", ",", context) // Covers JDK 10 + else -> null + } } - ) + } +) |