diff options
Diffstat (limited to 'plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt')
-rw-r--r-- | plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt index 6c4869d8..e48aa926 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt @@ -2,30 +2,23 @@ package org.jetbrains.dokka.base.resolvers.local import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet -import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.resolvers.external.ExternalLocationProvider import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext -import org.jetbrains.dokka.plugability.plugin -import org.jetbrains.dokka.plugability.query import java.net.HttpURLConnection import java.net.URL import java.net.URLConnection import java.util.* private const val PAGE_WITH_CHILDREN_SUFFIX = "index" -private const val DOKKA_PARAM_PREFIX = "\$dokka." open class DefaultLocationProvider( protected val pageGraphRoot: RootPageNode, - protected val dokkaContext: DokkaContext -) : LocationProvider { + dokkaContext: DokkaContext +) : BaseLocationProvider(dokkaContext) { protected open val extension = ".html" - protected val externalLocationProviderFactories = - dokkaContext.plugin<DokkaBase>().query { externalLocationProviderFactory } - protected val pagesIndex: Map<DRI, ContentPage> = pageGraphRoot.asSequence().filterIsInstance<ContentPage>() .map { it.dri.map { dri -> dri to it } }.flatten() .groupingBy { it.first } @@ -49,12 +42,7 @@ open class DefaultLocationProvider( override fun resolve(dri: DRI, sourceSets: Set<DokkaSourceSet>, context: PageNode?): String = pagesIndex[dri]?.let { resolve(it, context) } ?: // Not found in PageGraph, that means it's an external link - getLocation( - dri, - sourceSets - .groupBy({ it.jdkVersion }, { it.externalDocumentationLinks }) - .map { it.key to it.value.flatten().distinct() }.toMap() - ) + getExternalLocation(dri, sourceSets) override fun resolveRoot(node: PageNode): String = pathTo(pageGraphRoot, node).removeSuffix(PAGE_WITH_CHILDREN_SUFFIX) @@ -105,7 +93,7 @@ open class DefaultLocationProvider( // Not in cache, resolve packageLists for ((jdk, links) in toResolve) { for (link in links) { - if (dokkaContext.configuration.offlineMode && link.packageListUrl.protocol.toLowerCase() != "file") + if(dokkaContext.configuration.offlineMode && link.packageListUrl.protocol.toLowerCase() != "file") continue val locationInfo = loadPackageList(jdk, link.packageListUrl) |