Table of Contents

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

path string

The path to adjust including the filename

basePath string

The 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