DocFormatter Class

Namespace
Kampute.DocToolkit.Formatters
Assembly
  • Kampute.DocToolkit.dll

Definition

Represents a base class for a documentation formatter.
public abstract class DocFormatter : IDocumentFormatter
Inheritance
Implements
Inherited by

Remarks

The DocFormatter class serves as a foundation for creating documentation formatters that generate content in specific formats (such as HTML or Markdown). It provides common functionality for transforming XML documentation comments, encoding text, and managing file format support.

Derived classes must implement specific formatting logic for their target format by overriding abstract methods like Encode(ReadOnlySpan<char>, TextWriter) and CreateMarkupWriter(TextWriter, bool).

Constructors

DocFormatter(string)Initializes a new instance of the DocFormatter class.

Properties

FileExtensionGets the file extension of the documentation files in the target format.
TextTransformersGets the text transformer registry for the target format.
XmlDocTransformerGets the XML documentation transformer for the target format.

Methods

CreateMarkupWriter(TextWriter, bool)Creates an instance of MarkupWriter class that wraps the specified writer for encoding content in the target format.
CreateMinifier(TextWriter)Creates a TextWriter instance that wraps the specified writer to minimize the content for target format.
Encode(ReadOnlySpan<char>, TextWriter)Encodes the specified text for the target format and writes it to the specified writer.
Transform(TextWriter, XElement)Writes the transformed content of the XML comment element to the specified TextWriter.