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
Implements

Remarks

The TopicModel class serves as a bridge between a topic source and the documentation system. It wraps an ITopic with a specific IDocumentationContext, allowing the topic to be rendered with contextual information such as formatting preferences and addressing strategies.

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.

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

ContextGets the documentation context associated with the topic.
HierarchyPathGets the hierarchy of parent topics that lead to this topic.
IdGets the qualified identifier of the topic.
ModelTypeGets the type of the documentation model.
NameGets the title of the topic.
ParentTopicGets the parent topic of the current topic.
SourceGets the source of the topic.
SubtopicsGets the subtopics of the current topic.
UrlGets 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.