Skip to content

V3.0.0#11

Merged
kampute merged 8 commits into
mainfrom
v3.0.0
Jul 12, 2026
Merged

V3.0.0#11
kampute merged 8 commits into
mainfrom
v3.0.0

Conversation

@kampute

@kampute kampute commented Jul 12, 2026

Copy link
Copy Markdown
Owner

This pull request introduces several important changes to the documentation pipeline, focusing on improving terminology consistency, refactoring URL transformation infrastructure, and updating versioning. The main themes are: a refactor of URL context and transformer classes for clarity and extensibility, terminology updates from "site-root-relative" to "documentation-root-relative", and a breaking version bump to 3.0.0.

URL Transformation Infrastructure Refactor:

  • Renamed RelativeToAbsoluteUrlNormalizer to AbsoluteUrlContextManager, updated its internal class and methods, and clarified its purpose as converting documentation-root-relative URLs to absolute URLs using a configurable documentation root. Updated constructor and method parameter names and XML docs accordingly. (src/Routing/AbsoluteUrlContextManager.cs) [1] [2] [3]
  • Updated DocumentAddressProvider to use AbsoluteUrlContextManager and RelativeUrlContextManager instead of the old normalizer classes, and changed the internal method to resolve documentation-root-relative paths. (src/Routing/DocumentAddressProvider.cs) [1] [2]

Terminology and Documentation Consistency:

  • Replaced all references to "site-root-relative" URLs with "documentation-root-relative" URLs in public interfaces, XML documentation, and comments for both IDocumentationContext and DocumentationContext. (src/IDocumentationContext.cs, src/DocumentationContext.cs) [1] [2] [3]
  • Updated the default URL transformer in DocumentationContext to be DocumentationUrlTransformer instead of ContextAwareUrlTransformer, reflecting the new naming and focus. (src/DocumentationContext.cs)

Bug Fix:

  • Fixed the logic in TopicCollection.TryFindBySubpath to correctly check if the given subpath is a subpath of the topic's source file path. (src/Collections/TopicCollection.cs)

Versioning:

  • Bumped the package version to 3.0.0 in the project file to indicate a breaking change. (src/Kampute.DocToolkit.csproj)

Other:

  • Removed the .github/copilot-instructions.md file, which previously contained project architecture and contribution guidelines.
  • Minor copyright header normalization. (src/DocumentationContext.cs, src/Routing/DocumentAddressProvider.cs) [1] [2]
  • Removed unnecessary System.Runtime.CompilerServices using. (src/Routing/DocumentUrlContext.cs)

These changes modernize and clarify the documentation generation infrastructure, making it easier to extend and maintain, and ensure terminology is consistent across the codebase.

Treat ~/ as an explicit documentation-root marker while preserving standard semantics for site-root and document-relative URLs. Normalize marked paths without allowing them to escape the documentation root, update both resolution strategies, and expand routing tests for the new behavior.
Rename the relative and absolute URL context managers and the documentation URL transformer to reflect their responsibilities. Rename DocumentUrlContext.IsRoot, RootUrl, TryTransformSiteRelativeUrl, and IsSiteRelativeUrl to IsDocumentationRoot, DocumentationRootUrl, TryResolveUrl, and TryParseDocumentationRelativeUrl, and update files, XML references, construction sites, and tests consistently.
Place the subpath before the full path so the call order follows the predicate's natural reading. Update the topic lookup, tests, and XML documentation without changing matching behavior.
- Add abstract ResolveFromDocumentationRoot method for core resolution logic
- Make TryResolveUrl concrete in base class to eliminate duplication
- Update DocumentAddressProvider.ToDocumentUrl to use new method directly
- Add comprehensive tests for ResolveFromDocumentationRoot
- Improve documentation for clarity and correctness

This change simplifies the API by removing the need to artificially prepend
'~/' markers when callers already know they have documentation-relative URLs.

Subclasses now only implement the resolution strategy, not parsing logic.
@kampute
kampute merged commit dc5c996 into main Jul 12, 2026
1 check passed
@kampute
kampute deleted the v3.0.0 branch July 12, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants