MarkupWriter Class

Namespace
Kampute.DocToolkit.IO.Writers
Assembly
  • Kampute.DocToolkit.dll

Definition

Provides a text writer for writing markup language content with encoding of special characters and structured document elements.
public abstract class MarkupWriter : WrappedTextWriter
Inheritance
Inherited by

Remarks

The MarkupWriter class is an abstract class that defines a common API for generating documentation in various markup formats This abstraction is built on the principle of separation of concerns:
  • The semantic structure of the content (headings, paragraphs, lists, tables)
  • The character escaping required by each markup language
  • The structural syntax for the target markup language
The class also provides link handling through specialized documentation link methods, which manage cross-references between code elements. These methods create links at different levels of granularity, from direct element links to component-based linking.

Thread Safety

Public static members of the type are guaranteed to be thread-safe. However, public instance members are not thread-safe.

Constructors

MarkupWriter(TextWriter, bool)Initializes a new instance of the MarkupWriter class.

Methods

CreateDocLinker(IApiDocUrlProvider)Creates a delegate for linking to the documentation of a type or type's member.
WriteBlockquote(Action<MarkupWriter>)Writes a blockquote in the format of the target document using an optional delegate to write the content.
WriteBlockquote(string)Writes a blockquote in the format of the target document using the specified text.
WriteCodeBlock(string, string)Writes a code block in the format of the target document.
WriteDocLink(MemberModel)Writes a hyperlink to the documentation of the specified member model.
WriteDocLink(NamespaceModel)Writes a hyperlink to the documentation of the specified namespace model.
WriteDocLink(Uri, Action<MarkupWriter>)Writes a hyperlink to the documentation of a code element with the specified URL and delegate for writing the link text.
WriteDocLink(IMember, IDocumentationContext)Writes a hyperlink to the documentation of the specified member.
WriteDocLink(IMember, IDocumentationContext, NameQualifier)Writes a hyperlink to the documentation of the specified member with a specific name qualification level.
WriteDocLink(string, IDocumentationContext, Func<IMember, NameQualifier>)Writes a hyperlink to the documentation of the specified code reference.
WriteDocLink(ICustomAttribute, IDocumentationContext, NameQualifier)Writes a hyperlink to the documentation of the specified attribute.
WriteEmphasis(Action<MarkupWriter>)Writes an emphasis in the format of the target document using an optional delegate to write the content.
WriteEmphasis(string)Writes an emphasis in the format of the target document using the specified text.
WriteHeading(int, Action<MarkupWriter>)Writes a heading in the format of the target document using an optional delegate to write the heading content.
WriteHeading(int, string)Writes a heading in the format of the target document using the specified text.
WriteHorizontalRule()Writes a horizontal rule in the format of the target document.
WriteImage(Uri, string)Writes an image as an embedded link in the format of the target document using the specified URL and an optional title.
WriteInlineCode(string)Writes a code span in the format of the target document using the specified text.
WriteLink(Uri, Action<MarkupWriter>)Writes a hyperlink in the format of the target document using an optional delegate to write the link's text.
WriteLink(Uri, string)Writes a hyperlink with the specified text in the format of the target document.
WriteList(IReadOnlyList<object>, bool)Writes a list in the format of the target document using the specified items.
WriteList(int, Action<MarkupWriter, int>, bool)Writes a list in the format of the target document using an optional delegate to write the list items.
WriteParagraph(Action<MarkupWriter>)Writes a paragraph in the format of the target document using an optional delegate to write the paragraph content.
WriteParagraph(string)Writes a paragraph in the format of the target document using the specified text.
WriteSafe(char)Writes a character to the text stream without encoding special characters.
WriteSafe(ReadOnlySpan<char>)Writes a string to the text stream without encoding special characters.
WriteStrong(Action<MarkupWriter>)Writes a strong emphasis in the format of the target document using an optional delegate to write the content.
WriteStrong(string)Writes a strong emphasis in the format of the target document using the specified text.
WriteTable(IReadOnlyList<string>, IReadOnlyList<IReadOnlyList<object>>)Writes a table in the format of the target document using the specified header and row columns.
WriteTable(IReadOnlyList<string>, int, Action<MarkupWriter, int, int>)Writes a table in the format of the target document using an optional delegate to write the content of each cell.