aboutsummaryrefslogtreecommitdiff
path: root/src/Locations/LocationService.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/Locations/LocationService.kt')
-rw-r--r--src/Locations/LocationService.kt9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Locations/LocationService.kt b/src/Locations/LocationService.kt
index 03f22d08..6472e906 100644
--- a/src/Locations/LocationService.kt
+++ b/src/Locations/LocationService.kt
@@ -2,7 +2,10 @@ package org.jetbrains.dokka
import java.io.File
-data class Location(val file: File)
+public data class Location(val file: File) {
+ public val path : String
+ get() = file.path
+}
public trait LocationService {
fun location(node: DocumentationNode): Location
@@ -11,8 +14,8 @@ public trait LocationService {
public fun escapeUri(path: String): String = path.replace('<', '_').replace('>', '_')
-fun LocationService.relativeLocation(node: DocumentationNode, link: DocumentationNode, extension: String): File {
+fun LocationService.relativeLocation(node: DocumentationNode, link: DocumentationNode, extension: String): Location {
val ownerFolder = location(node).file.getParentFile()!!
val memberPath = location(link).file.appendExtension(extension)
- return ownerFolder.getRelativePath(memberPath)
+ return Location(ownerFolder.getRelativePath(memberPath))
}