aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Locations
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-12-02 04:57:45 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-12-02 04:57:45 +0300
commitc7523225200a3e24d24fb3b0492d5c377246fc69 (patch)
treeb15a87588e3b125d826ba74b596509fe4bc7b280 /core/src/main/kotlin/Locations
parentc1abcaf32abd4e2d74b9246385b3541096cdb5b9 (diff)
downloaddokka-c7523225200a3e24d24fb3b0492d5c377246fc69.tar.gz
dokka-c7523225200a3e24d24fb3b0492d5c377246fc69.tar.bz2
dokka-c7523225200a3e24d24fb3b0492d5c377246fc69.zip
Make possible to calculate path to root
Diffstat (limited to 'core/src/main/kotlin/Locations')
-rw-r--r--core/src/main/kotlin/Locations/LocationService.kt6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Locations/LocationService.kt b/core/src/main/kotlin/Locations/LocationService.kt
index 6b7e0511..8ea45dae 100644
--- a/core/src/main/kotlin/Locations/LocationService.kt
+++ b/core/src/main/kotlin/Locations/LocationService.kt
@@ -94,4 +94,10 @@ fun identifierToFilename(path: String): String {
fun NodeLocationAwareGenerator.relativePathToLocation(owner: DocumentationNode, node: DocumentationNode): String {
return location(owner).relativePathTo(location(node), null)
+}
+
+
+fun NodeLocationAwareGenerator.relativeToRoot(from: Location): File {
+ val file = File(from.path)
+ return file.relativeTo(root)
} \ No newline at end of file