diff --git a/README.md b/README.md index 1e2bd03..22e589c 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,9 @@ is a simple file path library for Carp. The `Path` module mostly operates on `String` arguments. It allows you to split, join, merge, and normalize paths and extensions in a lot of different ways. `normalize` resolves `.`/`..` segments and collapses repeated separators -lexically (without touching the filesystem). It also has some functions to work -with the `PATH` environment variable. +lexically (without touching the filesystem), and `relative` expresses one path +relative to a base the same way. It also has some functions to work with the +`PATH` environment variable. It assumes either Windows or POSIX-style separators. diff --git a/docs/Path.html b/docs/Path.html index 1e371ee..e016ca0 100644 --- a/docs/Path.html +++ b/docs/Path.html @@ -363,6 +363,31 @@
+ (Fn [(Ref String a), (Ref String b)] (Maybe String)) +
++ (relative target base) ++
+
computes the path to target relative to base, purely
+lexically. It is the companion to absolute.
Both paths are normalized first, so ., .., and redundant separators are
+resolved before comparing. Returns Nothing when the paths cannot be related
+lexically: one absolute and one relative, or, on Windows, rooted at different
+drives. Equal paths yield Just ".".
+ (Fn [(Ref String a), (Ref String b)] (Maybe String)) +
++ (relative target base) ++
+
computes the path to target relative to base, purely
+lexically. It is the companion to absolute.
Both paths are normalized first, so ., .., and redundant separators are
+resolved before comparing. Returns Nothing when the paths cannot be related
+lexically: one absolute and one relative, or, on Windows, rooted at different
+drives. Equal paths yield Just ".".