diff options
Diffstat (limited to 'core/src/main/kotlin/Locations/Location.kt')
-rw-r--r-- | core/src/main/kotlin/Locations/Location.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/main/kotlin/Locations/Location.kt b/core/src/main/kotlin/Locations/Location.kt index 0e6572d9..4cb0ac39 100644 --- a/core/src/main/kotlin/Locations/Location.kt +++ b/core/src/main/kotlin/Locations/Location.kt @@ -53,9 +53,9 @@ fun NodeLocationAwareGenerator.relativePathToLocation(owner: DocumentationNode, return location(owner).relativePathTo(location(node), null) } -fun NodeLocationAwareGenerator.relativeToRoot(from: Location): File { - val file = File(from.path) - return file.relativeTo(root) +fun NodeLocationAwareGenerator.relativePathToRoot(from: Location): File { + val file = File(from.path).parentFile + return root.relativeTo(file) } fun File.toUnixString() = toString().replace(File.separatorChar, '/') |