diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-08-24 15:06:36 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-25 13:12:48 +0200 |
commit | cd3f48ec64e60221bd63720fa24cff8fd7afe6c7 (patch) | |
tree | e01483148b5d7ef5afa7c7090d82a8bdba7d7db0 /plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProvider.kt | |
parent | 293d8788b5188cb29a8c792e7d54377b57963f3b (diff) | |
download | dokka-cd3f48ec64e60221bd63720fa24cff8fd7afe6c7.tar.gz dokka-cd3f48ec64e60221bd63720fa24cff8fd7afe6c7.tar.bz2 dokka-cd3f48ec64e60221bd63720fa24cff8fd7afe6c7.zip |
Fix external links to Android and Androix documentations
Diffstat (limited to 'plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProvider.kt')
-rw-r--r-- | plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProvider.kt | 18 |
1 files changed, 11 insertions, 7 deletions
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 60aa540a..d4f44a94 100644 --- a/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/external/javadoc/JavadocExternalLocationProvider.kt @@ -2,11 +2,12 @@ package org.jetbrains.dokka.base.resolvers.external.javadoc import org.jetbrains.dokka.base.resolvers.external.DefaultExternalLocationProvider import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation +import org.jetbrains.dokka.links.Callable import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.utilities.htmlEscape -class JavadocExternalLocationProvider( +open class JavadocExternalLocationProvider( externalDocumentation: ExternalDocumentation, val brackets: String, val separator: String, @@ -21,13 +22,16 @@ class JavadocExternalLocationProvider( if (dri.classNames == null) { return "$docURL$packageLink/package-summary$extension".htmlEscape() } - val classLink = if (packageLink == null) "${dri.classNames}$extension" else "$packageLink/${dri.classNames}$extension" + val classLink = + if (packageLink == null) "${dri.classNames}$extension" else "$packageLink/${dri.classNames}$extension" val callableChecked = dri.callable ?: return "$docURL$classLink".htmlEscape() - return ("$docURL$classLink#" + - callableChecked.name + - "${brackets.first()}" + - callableChecked.params.joinToString(separator) + - "${brackets.last()}").htmlEscape() + return ("$docURL$classLink#" + anchorPart(callableChecked)).htmlEscape() } + + protected open fun anchorPart(callable: Callable) = callable.name + + "${brackets.first()}" + + callable.params.joinToString(separator) + + "${brackets.last()}" + } |