MarkdownAddressingStrategy Class
- Namespace
- Kampute.DocToolkit.Routing
- Assembly
- Kampute.DocToolkit.dll
Definition
Provides an abstract base class for Markdown-based addressing strategies that organize documentation pages as a hierarchy of pages named after their titles.
public abstract class MarkdownAddressingStrategy : AddressingStrategy, ILanguageSpecific, IContextualAddressingStrategy- Inheritance
- object
- AddressingStrategy
- MarkdownAddressingStrategy
- Implements
- Inherited by
Remarks
Thread Safety
Public instance members can be considered thread-safe if neither MarkdownAddressingOptions.MainTopicId nor MarkdownAddressingOptions.ApiTopicId is set in the construction options of the instance. If either property is set, instance members are only thread-safe if the instance is fully initialized (that is, IContextualAddressingStrategy.InitializeWithContext(IDocumentationContext) has been called) before any other method is accessed, and there is no concurrent access during or before initialization.
The class is not thread-safe otherwise, because it contains a mutable context field and uses lazy initialization that depends on this field, without synchronization.
Constructors
| MarkdownAddressingStrategy(MarkdownAddressingOptions) | Initializes a new instance of the MarkdownAddressingStrategy class. |
Properties
| ApiPath | Gets the file path of the API documentation page. |
| Granularity | Gets the page granularity used for organizing documentation content. |
| Language | Gets the programming language formatter used for formatting member names. |
| MainPath | Gets the file path of the main documentation page. |
Methods
| EncodeFragmentIdentifier(string) | Converts the text of a heading to the fragment identifier that addresses the heading. |
| EncodePageName(string) | Converts the specified title to the name of a page, as it appears in the file path and URL of the page. |
| GetNamespacePath(string) | Retrieves the relative documentation path for the specified namespace. |
| GetTopicPath(ITopic) | Retrieves the relative documentation path for the specified topic. |
| GetTypePath(IType) | Retrieves the relative documentation path for the specified type. |
| IsAddressable(IMember) | Determines whether the specified member can be addressed by this strategy. |
| IsMainTopic(ITopic) | Determines whether the specified topic is the main topic of the documentation. |
| 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. |
Explicit Interface Implementations
| IContextualAddressingStrategy.InitializeWithContext(IDocumentationContext) | Binds the addressing strategy to the specified documentation context. |
Extension Methods
| TryResolveAddressByCodeReference(this IDocumentAddressingStrategy, string, out IResourceAddress) | Attempts to resolve the address of the documentation content for the specified code reference. |

- Each namespace has a page named after the namespace.
- Each type has a page named after the type, nested under the page of its namespace.
- Type members are documented on the page of their declaring type, and are addressed by the anchor of their heading.
- Each topic has a page named after its title, nested under the page of its parent topic.
When MarkdownAddressingOptions.MainTopicId is set, all other pages are nested under the page of the main topic. When MarkdownAddressingOptions.ApiTopicId is set, the namespace pages are nested under the page of the API topic.Derived classes define how a title becomes a page name by implementing EncodePageName(string), and can override EncodeFragmentIdentifier(string) when the publishing target generates heading anchors differently from GitHub and GitLab. They can also override the methods that construct the page paths to change the page structure.