diff options
| author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-12-02 04:57:45 +0300 |
|---|---|---|
| committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-12-02 04:57:45 +0300 |
| commit | c7523225200a3e24d24fb3b0492d5c377246fc69 (patch) | |
| tree | b15a87588e3b125d826ba74b596509fe4bc7b280 /core/src/main/kotlin/Locations | |
| parent | c1abcaf32abd4e2d74b9246385b3541096cdb5b9 (diff) | |
| download | dokka-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.kt | 6 |
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 |
