DocFxStrategy Class
- Namespace
- Kampute.DocToolkit
- Assembly
- Kampute.DocToolkit.dll
Definition
Provides an addressing strategy for organizing and addressing documentation pages in a manner similar to the DocFX documentation generator.
public class DocFxStrategy : HtmlAddressingStrategy- Inheritance
- object
- AddressingStrategy
- HtmlAddressingStrategy
- DocFxStrategy
Remarks
Thread Safety
All public members of the type are guaranteed to be thread-safe.
Constructors
| DocFxStrategy() | Initializes a new instance of the DocFxStrategy class with default options. |
| DocFxStrategy(DocFxOptions) | Initializes a new instance of the DocFxOptions class with the specified options. |
Properties
| Granularity | Gets the page granularity used for organizing documentation content. |
Methods
| IsAddressable(IMember) | Determines whether the specified member can be addressed by this strategy. |
| TryResolveMemberAddress(IMember, out IResourceAddress) | Attempts to resolve the address of the documentation content for the specified member. |
| TryResolveNamespaceAddress(string, out IResourceAddress) | Attempts to resolve the address of the documentation content for the specified namespace. |
| TryResolveTopicAddress(ITopic, out IResourceAddress) | Attempts to resolve the address for the documentation content of the specified topic. |
Extension Methods
| TryResolveAddressByCodeReference(this IDocumentAddressingStrategy, string, out IResourceAddress) | Attempts to resolve the address of the documentation content for the specified code reference. |

The strategy organizes API documentation with namespaces and types documented on separate pages, while type members such as methods, properties, fields, and events are consolidated on their declaring type's page. URL fragments enable direct navigation to specific members within consolidated pages, maintaining clean URLs while preserving precise addressing.
Topic organization follows a hierarchical structure based on parent-child relationships. Topics with subtopics use index files to serve as landing pages, with topic paths preserving original naming while replacing invalid file system characters with underscores. Pinned topics can override default paths for custom organization.
Key features of the DocFxStrategy addressing strategy include:- DocFX-compatible path structure where type members are documented on the same page as their containing type
- URL fragments for direct navigation to specific members within type pages
- Hierarchical topic organization and pinned topic functionality for custom path overrides
This strategy is ideal for small to medium-sized APIs where consolidated member documentation improves readability, and for projects maintaining compatibility with existing DocFX-generated documentation.