aboutsummaryrefslogtreecommitdiff
path: root/src/Locations
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-15 15:54:05 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-15 15:54:05 +0400
commit62cb509a1a5adf0e5f9ba8d8e7545a93eb8516b2 (patch)
tree52e0ad3452a198ee279df8ed3e93c9c0a39a5f6b /src/Locations
parentad884a9ce79f191f3a7b7aed115080e341265ef3 (diff)
downloaddokka-62cb509a1a5adf0e5f9ba8d8e7545a93eb8516b2.tar.gz
dokka-62cb509a1a5adf0e5f9ba8d8e7545a93eb8516b2.tar.bz2
dokka-62cb509a1a5adf0e5f9ba8d8e7545a93eb8516b2.zip
Refactor formatting service to detach grouping logic from markup
Diffstat (limited to 'src/Locations')
-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))
}