BuildComponentUtilities.GetRelativePath Method
Definition
- Namespace
- Sandcastle.Core.BuildAssembler
- Assembly
- Sandcastle.Core.dll
This returns the path argument adjusted to be relative to the base path. Absolute path names will be returned unchanged.
public static string GetRelativePath(this string path, string basePath)
Parameters
pathstringThe path to adjust including the filename
basePathstringThe base path to use including the filename
Returns
- string
The path argument as a path relative to the given base path
Examples
path: "xxx/aaa/target.html"
basePath: "xxx/bbb/source.html"
result: "../aaa/target.html"
Remarks
This assumes that the path separator is "/" and that both paths include a filename