DocumentationUrlTransformer.TryTransformUrl Method
- Namespace
- Kampute.DocToolkit.Routing
- Assembly
- Kampute.DocToolkit.dll
Definition
Attempts to transform a URL string into an absolute or document-relative URL.
public virtual bool TryTransformUrl(string urlString, [NotNullWhen(true)] out Uri transformedUrl)Parameters
urlStringstring- The URL string to transform.
transformedUrlUri- When this method returns, contains the transformed URL if the method returns
true; otherwise,null. This parameter is passed uninitialized.

- Topic references are resolved to their corresponding URLs.
- File references in topics are resolved to either absolute or document-relative URLs.
- URLs beginning with
The method will not transform the provided URL when it matches any of the following:~/are resolved from the documentation root.- Empty or consists only of white-space.
- A query or fragment-only URL (for example, "#section" or "?q=1").
- An absolute or site-root-relative URL (for example, starting with a scheme like "http:" or a leading "/").
- An unresolved document-relative URL without the
Resolving a topic-relative file reference may read file-system metadata to determine whether the referenced file exists. The operation does not create or modify files and does not change the active document URL context.~/marker.