diff options
Diffstat (limited to 'core/src/main/kotlin/defaultExternalLinks.kt')
-rw-r--r-- | core/src/main/kotlin/defaultExternalLinks.kt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/core/src/main/kotlin/defaultExternalLinks.kt b/core/src/main/kotlin/defaultExternalLinks.kt new file mode 100644 index 00000000..d8c95076 --- /dev/null +++ b/core/src/main/kotlin/defaultExternalLinks.kt @@ -0,0 +1,31 @@ +package org.jetbrains.dokka + +import org.jetbrains.dokka.DokkaConfiguration.ExternalDocumentationLink +import java.net.URL + + +fun ExternalDocumentationLink.Companion.jdk(jdkVersion: Int): ExternalDocumentationLinkImpl { + return ExternalDocumentationLink( + url = + if (jdkVersion < 11) "https://docs.oracle.com/javase/${jdkVersion}/docs/api/" + else "https://docs.oracle.com/en/java/javase/${jdkVersion}/docs/api/java.base/", + packageListUrl = + if (jdkVersion < 11) "https://docs.oracle.com/javase/${jdkVersion}/docs/api/package-list" + else "https://docs.oracle.com/en/java/javase/${jdkVersion}/docs/api/element-list" + ) +} + +fun ExternalDocumentationLink.Companion.kotlinStdlib(): ExternalDocumentationLinkImpl { + return ExternalDocumentationLink("https://kotlinlang.org/api/latest/jvm/stdlib/") +} + +fun ExternalDocumentationLink.Companion.androidSdk(): ExternalDocumentationLinkImpl { + return ExternalDocumentationLink("https://developer.android.com/reference/") +} + +fun ExternalDocumentationLink.Companion.androidX(): ExternalDocumentationLinkImpl { + return ExternalDocumentationLink( + url = URL("https://developer.android.com/reference/kotlin/"), + packageListUrl = URL("https://developer.android.com/reference/androidx/package-list") + ) +} |