diff options
Diffstat (limited to 'plugins/base/src/main/kotlin/resolvers')
4 files changed, 8 insertions, 8 deletions
diff --git a/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt index 7387789b..06730641 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt @@ -25,7 +25,7 @@ abstract class BaseLocationProvider(protected val dokkaContext: DokkaContext) : protected fun getExternalLocation( dri: DRI, sourceSets: Set<DisplaySourceSet> - ): String { + ): String? { val jdkToExternalDocumentationLinks = dokkaContext.configuration.sourceSets .filter { sourceSet -> sourceSet.sourceSetID in sourceSets.sourceSetIDs } .groupBy({ it.jdkVersion }, { it.externalDocumentationLinks }) @@ -55,7 +55,7 @@ abstract class BaseLocationProvider(protected val dokkaContext: DokkaContext) : } toResolve.remove(jdk) } - return "" + return null } private fun getLink(dri: DRI, locationInfo: DefaultLocationProvider.LocationInfo): String = diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt index b9df45ae..1c27959f 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt @@ -48,10 +48,10 @@ open class DefaultLocationProvider( pageGraphRoot.children.forEach { registerPath(it, emptyList()) } } - override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String = + override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean) = pathTo(node, context) + if (!skipExtension) extension else "" - override fun resolve(dri: DRI, sourceSets: Set<DisplaySourceSet>, context: PageNode?): String = + override fun resolve(dri: DRI, sourceSets: Set<DisplaySourceSet>, context: PageNode?) = pagesIndex[dri]?.let { resolve(it, context) } ?: anchorsIndex[dri]?.let { resolve(it, context) + "#$dri" } // Not found in PageGraph, that means it's an external link diff --git a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt index 5077195f..391af004 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt @@ -6,8 +6,8 @@ import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.pages.RootPageNode interface LocationProvider { - fun resolve(dri: DRI, sourceSets: Set<DisplaySourceSet>, context: PageNode? = null): String - fun resolve(node: PageNode, context: PageNode? = null, skipExtension: Boolean = false): String + fun resolve(dri: DRI, sourceSets: Set<DisplaySourceSet>, context: PageNode? = null): String? + fun resolve(node: PageNode, context: PageNode? = null, skipExtension: Boolean = false): String? fun resolveRoot(node: PageNode): String fun ancestors(node: PageNode): List<PageNode> } diff --git a/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt index 75c2ccf6..5d2a96d5 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt @@ -14,12 +14,12 @@ class MultimoduleLocationProvider(private val root: RootPageNode, context: Dokka it.name to it.path }.toMap() - override fun resolve(dri: DRI, sourceSets: Set<DisplaySourceSet>, context: PageNode?): String = + override fun resolve(dri: DRI, sourceSets: Set<DisplaySourceSet>, context: PageNode?) = dri.takeIf { it.packageName == MULTIMODULE_PACKAGE_PLACEHOLDER }?.classNames?.let { paths[it] }?.let { "$it/${identifierToFilename(dri.classNames.orEmpty())}/index.html" } ?: defaultLocationProvider.resolve(dri, sourceSets, context) - override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String = + override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean) = defaultLocationProvider.resolve(node, context, skipExtension) override fun resolveRoot(node: PageNode): String = defaultLocationProvider.resolveRoot(node) |