ContextAwareUrlNormalizer Class

Namespace
Kampute.DocToolkit.Routing
Assembly
  • Kampute.DocToolkit.dll

Definition

Normalizes relative URLs based on the current document context to ensure proper navigation.
public sealed class ContextAwareUrlNormalizer : DocumentUrlContextManager
Inheritance

Remarks

This class adjusts relative URLs based on the location of the current document being rendered. It ensures that navigation remains consistent regardless of the document hierarchy by calculating the correct relative path between documents.

For example, if a document at api/namespace/class.html references another document at api/other-namespace/interface.html, this normalizer ensures the relative path is correctly calculated as ../other-namespace/interface.html. In this case, the base URL of the documentation site relative to the current document is ../../.

Thread Safety

All public members of the type are guaranteed to be thread-safe.

Constructors

ContextAwareUrlNormalizer()Initializes a new instance of the ContextAwareUrlNormalizer class.

Methods

CreateScope(string, IDocumentModel)Creates a new scope for the specified directory path and document model.

See Also