aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/resolvers
diff options
context:
space:
mode:
authorBłażej Kardyś <bkardys@virtuslab.com>2020-11-20 17:23:10 +0100
committerBłażej Kardyś <bkardys@virtuslab.com>2020-11-27 03:15:02 +0100
commit3cb4702a68139788de6e1f7b087ced345f2b71ba (patch)
treea383471c9915ae4aaff078b4f3b81bb99a4fde35 /plugins/base/src/main/kotlin/resolvers
parent076a5f421c5e4621539efd814be612f43fef33f5 (diff)
downloaddokka-3cb4702a68139788de6e1f7b087ced345f2b71ba.tar.gz
dokka-3cb4702a68139788de6e1f7b087ced345f2b71ba.tar.bz2
dokka-3cb4702a68139788de6e1f7b087ced345f2b71ba.zip
Changing how multimodule location provider works and improving gfm link substitution
Diffstat (limited to 'plugins/base/src/main/kotlin/resolvers')
-rw-r--r--plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt4
-rw-r--r--plugins/base/src/main/kotlin/resolvers/local/DokkaBaseLocationProvider.kt5
-rw-r--r--plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt4
-rw-r--r--plugins/base/src/main/kotlin/resolvers/shared/PackageList.kt5
4 files changed, 5 insertions, 13 deletions
diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt
index 293ca2d4..c956b308 100644
--- a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt
@@ -4,7 +4,6 @@ import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.resolvers.external.ExternalLocationProvider
import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation
import org.jetbrains.dokka.base.resolvers.shared.PackageList
-import org.jetbrains.dokka.base.resolvers.anchors.SymbolAnchorHint
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.DisplaySourceSet
import org.jetbrains.dokka.pages.RootPageNode
@@ -14,8 +13,7 @@ import org.jetbrains.dokka.plugability.query
abstract class DefaultLocationProvider(
protected val pageGraphRoot: RootPageNode,
- protected val dokkaContext: DokkaContext,
- protected val extension: String
+ protected val dokkaContext: DokkaContext
) : LocationProvider {
protected val externalLocationProviderFactories =
dokkaContext.plugin<DokkaBase>().query { externalLocationProviderFactory }
diff --git a/plugins/base/src/main/kotlin/resolvers/local/DokkaBaseLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DokkaBaseLocationProvider.kt
index b1213b19..fa133045 100644
--- a/plugins/base/src/main/kotlin/resolvers/local/DokkaBaseLocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/local/DokkaBaseLocationProvider.kt
@@ -8,9 +8,8 @@ import org.jetbrains.dokka.utilities.urlEncoded
abstract class DokkaBaseLocationProvider(
pageGraphRoot: RootPageNode,
- dokkaContext: DokkaContext,
- extension: String
-) : DefaultLocationProvider(pageGraphRoot, dokkaContext, extension) {
+ dokkaContext: DokkaContext
+) : DefaultLocationProvider(pageGraphRoot, dokkaContext) {
/**
* Anchors should be unique and should contain sourcesets, dri and contentKind.
diff --git a/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt
index 437a1c58..c10029bc 100644
--- a/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt
@@ -14,8 +14,8 @@ import java.util.*
open class DokkaLocationProvider(
pageGraphRoot: RootPageNode,
dokkaContext: DokkaContext,
- extension: String = ".html"
-) : DokkaBaseLocationProvider(pageGraphRoot, dokkaContext, extension) {
+ val extension: String = ".html"
+) : DokkaBaseLocationProvider(pageGraphRoot, dokkaContext) {
protected open val PAGE_WITH_CHILDREN_SUFFIX = "index"
protected open val pathsIndex: Map<PageNode, List<String>> = IdentityHashMap<PageNode, List<String>>().apply {
diff --git a/plugins/base/src/main/kotlin/resolvers/shared/PackageList.kt b/plugins/base/src/main/kotlin/resolvers/shared/PackageList.kt
index e4b8fb6f..089bda55 100644
--- a/plugins/base/src/main/kotlin/resolvers/shared/PackageList.kt
+++ b/plugins/base/src/main/kotlin/resolvers/shared/PackageList.kt
@@ -1,7 +1,6 @@
package org.jetbrains.dokka.base.resolvers.shared
import org.jetbrains.dokka.base.renderers.PackageListService
-import java.io.File
import java.net.URL
data class PackageList(
@@ -15,9 +14,6 @@ data class PackageList(
if (offlineMode && url.protocol.toLowerCase() != "file")
return null
- /*if (!File(url.file).isFile)
- return null*/
-
val packageListStream = url.readContent()
val (params, packages) = packageListStream
@@ -31,7 +27,6 @@ data class PackageList(
return PackageList(format, packages.filter(String::isNotBlank).toSet(), locations, url)
}
-
private fun splitParams(params: List<String>) = params.asSequence()
.map { it.removePrefix("${PackageListService.DOKKA_PARAM_PREFIX}.").split(":", limit = 2) }
.groupBy({ (key, _) -> key }, { (_, value) -> value })