TopicModel Class
- Namespace
- Kampute.DocToolkit.Models
- Assembly
- Kampute.DocToolkit.dll
Definition
Represents a documentation model for a topic within a documentation context.
public class TopicModel : IDocumentModel, IEquatable<TopicModel>- Inheritance
- object
- TopicModel
- Implements
Remarks
Thread Safety
All public members of the type are guaranteed to be thread-safe.
Constructors
| TopicModel(IDocumentationContext, ITopic) | Initializes a new instance of the TopicModel class with the specified context and top-level source topic. |
Properties
| Context | Gets the documentation context associated with the topic. |
| HierarchyPath | Gets the hierarchy of parent topics that lead to this topic. |
| Id | Gets the qualified identifier of the topic. |
| ModelType | Gets the type of the documentation model. |
| Name | Gets the title of the topic. |
| ParentTopic | Gets the parent topic of the current topic. |
| Source | Gets the source of the topic. |
| Subtopics | Gets the subtopics of the current topic. |
| Url | Gets the URL of the topic. |
Methods
| CreateSubtopic(ITopic) | Creates a subtopic from the specified source topic. |
| Equals(TopicModel) | Determines whether the specified TopicModel is equal to the current TopicModel instance. |
| Equals(object) | Determines whether the specified object is equal to the current instance. |
| GetHashCode() | Returns a hash code for the current TopicModel instance. |
| Render(TextWriter) | Renders the content of the topic to the specified TextWriter. |
| ToString() | Returns a string that represents the current TopicModel instance. |
| TryGetDocumentationFile(out string) | Attempts to get the relative file path of the documentation file for the topic. |

Topics are designed to support cross-referencing between different documentation pages. This system ensures that links between topics remain valid regardless of how the documentation is generated or rendered, even when the underlying structure changes.
Topics also enable content transformation, converting source content (like Markdown files) into the target documentation format (such as HTML) during the rendering process.