aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt9
-rw-r--r--plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt5
2 files changed, 9 insertions, 5 deletions
diff --git a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt
index c8ef7cbc..da2859d9 100644
--- a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt
+++ b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt
@@ -90,10 +90,10 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent
private fun ContentNode.addTable(table: ContentGroup): ContentNode =
when (this) {
is ContentGroup -> {
- if(hasTabbedContent()){
+ if (hasTabbedContent()) {
copy(
children = children.map {
- if(it.hasStyle(ContentStyle.TabbedContent) && it is ContentGroup){
+ if (it.hasStyle(ContentStyle.TabbedContent) && it is ContentGroup) {
it.copy(children = it.children + table)
} else {
it
@@ -123,7 +123,10 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent
data class SourceLink(val path: String, val url: String, val lineSuffix: String?, val sourceSetData: DokkaSourceSet) {
constructor(sourceLinkDefinition: DokkaConfiguration.SourceLinkDefinition, sourceSetData: DokkaSourceSet) : this(
- sourceLinkDefinition.localDirectory, sourceLinkDefinition.remoteUrl, sourceLinkDefinition.remoteLineSuffix, sourceSetData
+ sourceLinkDefinition.localDirectory,
+ sourceLinkDefinition.remoteUrl.toExternalForm(),
+ sourceLinkDefinition.remoteLineSuffix,
+ sourceSetData
)
}
diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
index 40c87b75..f93678a4 100644
--- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
+++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.utils.addToStdlib.cast
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
+import java.net.URL
import java.nio.file.Paths
class LinkableContentTest : AbstractCoreTest() {
@@ -70,7 +71,7 @@ class LinkableContentTest : AbstractCoreTest() {
sourceLinks = listOf(
SourceLinkDefinitionImpl(
localDirectory = "jsMain/kotlin",
- remoteUrl = "https://github.com/user/repo/tree/master/src/jsMain/kotlin",
+ remoteUrl = URL("https://github.com/user/repo/tree/master/src/jsMain/kotlin"),
remoteLineSuffix = "#L"
)
)
@@ -83,7 +84,7 @@ class LinkableContentTest : AbstractCoreTest() {
sourceLinks = listOf(
SourceLinkDefinitionImpl(
localDirectory = "jvmMain/kotlin",
- remoteUrl = "https://github.com/user/repo/tree/master/src/jvmMain/kotlin",
+ remoteUrl = URL("https://github.com/user/repo/tree/master/src/jvmMain/kotlin"),
remoteLineSuffix = "#L"
)
)