aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin
diff options
context:
space:
mode:
authorBłażej Kardyś <bkardys@virtuslab.com>2020-06-23 22:25:18 +0200
committerPaweł Marks <pmarks@virtuslab.com>2020-06-26 00:40:47 +0200
commita1c316e829827ddb0e3e288e684ac287e8fd28ff (patch)
tree0a421ff350f1018b6c57a0674142ec3da66d9c25 /plugins/base/src/main/kotlin
parentfb9a5abfc24e93b918693f78a8f555da2c5a359f (diff)
downloaddokka-a1c316e829827ddb0e3e288e684ac287e8fd28ff.tar.gz
dokka-a1c316e829827ddb0e3e288e684ac287e8fd28ff.tar.bz2
dokka-a1c316e829827ddb0e3e288e684ac287e8fd28ff.zip
Briefs raw rendering and basic url handling
Diffstat (limited to 'plugins/base/src/main/kotlin')
-rw-r--r--plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt2
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt2
-rw-r--r--plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt2
-rw-r--r--plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt2
-rw-r--r--plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt2
5 files changed, 5 insertions, 5 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt
index 09d6cad1..4313f1e3 100644
--- a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt
+++ b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt
@@ -104,7 +104,7 @@ abstract class DefaultRenderer<T>(
is ContentHeader -> buildHeader(node, pageContext, sourceSetRestriction)
is ContentCode -> buildCode(node, pageContext)
is ContentDRILink ->
- buildLink(locationProvider.resolve(node.address, node.sourceSets.toList(), pageContext)) {
+ buildLink(locationProvider.resolve(node.address, node.sourceSets, pageContext)) {
buildLinkText(node.children, pageContext, sourceSetRestriction)
}
is ContentResolvedLink -> buildLink(node.address) {
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
index d56ab50c..de892bb1 100644
--- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
@@ -526,7 +526,7 @@ open class HtmlRenderer(
platforms: List<DokkaSourceSet>,
from: PageNode? = null,
block: FlowContent.() -> Unit
- ) = buildLink(locationProvider.resolve(to, platforms, from), block)
+ ) = buildLink(locationProvider.resolve(to, platforms.toSet(), from), block)
override fun buildError(node: ContentNode) {
context.logger.error("Unknown ContentNode type: $node")
diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt
index 4d44fdef..6c4869d8 100644
--- a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt
@@ -46,7 +46,7 @@ open class DefaultLocationProvider(
override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String =
pathTo(node, context) + if (!skipExtension) extension else ""
- override fun resolve(dri: DRI, sourceSets: List<DokkaSourceSet>, context: PageNode?): String =
+ 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(
diff --git a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt
index d6d616f3..745636d0 100644
--- a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt
@@ -6,7 +6,7 @@ import org.jetbrains.dokka.pages.PageNode
import org.jetbrains.dokka.pages.RootPageNode
interface LocationProvider {
- fun resolve(dri: DRI, sourceSets: List<DokkaSourceSet>, context: PageNode? = null): String
+ fun resolve(dri: DRI, sourceSets: Set<DokkaSourceSet>, 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 39b005a1..1d41bce0 100644
--- a/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt
@@ -14,7 +14,7 @@ class MultimoduleLocationProvider(private val root: RootPageNode, context: Dokka
it.name to it.path
}.toMap()
- override fun resolve(dri: DRI, sourceSets: List<DokkaSourceSet>, context: PageNode?): String =
+ override fun resolve(dri: DRI, sourceSets: Set<DokkaSourceSet>, context: PageNode?): String =
dri.takeIf { it.packageName == MULTIMODULE_PACKAGE_PLACEHOLDER }?.classNames?.let { paths[it] }?.let {
"$it/${dri.classNames}/index.html"
} ?: defaultLocationProvider.resolve(dri, sourceSets, context)