From 62cb509a1a5adf0e5f9ba8d8e7545a93eb8516b2 Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Tue, 15 Jul 2014 15:54:05 +0400 Subject: Refactor formatting service to detach grouping logic from markup --- src/Locations/LocationService.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/Locations') 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)) } -- cgit