MarkdownRenderer
Namespace: TagBites.Text.Markdown
Assembly: TagBites.Text.Markdown.dll
Product: TagBites.Text.Markdown v. 2.2.0
The output an element writes itself into.
public abstract class MarkdownRendererInheritance: object → MarkdownRenderer
Constructors
Section titled “Constructors”MarkdownRenderer(MarkdownFormat)
Section titled “MarkdownRenderer(MarkdownFormat)”Creates a renderer that writes with the given format, which the constructor makes read-only.
protected MarkdownRenderer(MarkdownFormat format)Parameters
Section titled “Parameters”formatMarkdownFormat
Properties
Section titled “Properties”Format
Section titled “Format”Gets the format the document is written with.
public MarkdownFormat Format { get; }Property Value
Section titled “Property Value”Length
Section titled “Length”Gets the number of characters written so far.
public virtual int Length { get; }Property Value
Section titled “Property Value”Prefix
Section titled “Prefix”Gets the text every new line starts with.
public string Prefix { get; }Property Value
Section titled “Property Value”SectionLevel
Section titled “SectionLevel”Gets the level of the section being written, where zero means no section.
public int SectionLevel { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Append(char)
Section titled “Append(char)”Appends a single character, writing the prefix at the start of a line.
public void Append(char value)Parameters
Section titled “Parameters”valuechar
Append(string)
Section titled “Append(string)”Appends a single character, writing the prefix at the start of a line.
public void Append(string value)Parameters
Section titled “Parameters”valuestring
Append(char, int)
Section titled “Append(char, int)”Appends value``count times.
public void Append(char value, int count)Parameters
Section titled “Parameters”Append(MarkdownText)
Section titled “Append(MarkdownText)”Appends the form of value that matches Format.
public void Append(MarkdownText value)Parameters
Section titled “Parameters”valueMarkdownText
AppendLine()
Section titled “AppendLine()”Ends the current line.
public void AppendLine()AppendSpaces(int)
Section titled “AppendSpaces(int)”Appends count spaces.
public void AppendSpaces(int count)Parameters
Section titled “Parameters”countint
Flush()
Section titled “Flush()”Sends everything the renderer still holds to its destination.
public virtual void Flush()OnLineWritten()
Section titled “OnLineWritten()”Runs after every line has been written.
protected virtual void OnLineWritten()PopPrefix()
Section titled “PopPrefix()”Removes the prefix added by the last PushPrefix(string).
public void PopPrefix()PopSectionLevel()
Section titled “PopSectionLevel()”Restores the level that was in place before the last PushSectionLevel(int).
public void PopSectionLevel()PushPrefix(string)
Section titled “PushPrefix(string)”Starts every following line with prefix on top of the current one.
public void PushPrefix(string prefix)Parameters
Section titled “Parameters”prefixstring
Remarks
Section titled “Remarks”An empty line receives the prefix without its trailing spaces, so a quote keeps its marker.
PushSectionLevel(int)
Section titled “PushSectionLevel(int)”Sets the level the sections written next are nested under.
public void PushSectionLevel(int level)Parameters
Section titled “Parameters”levelint
TruncateCore(int)
Section titled “TruncateCore(int)”Drops everything past length.
protected virtual char TruncateCore(int length)Parameters
Section titled “Parameters”lengthint
Returns
Section titled “Returns”The character the output now ends with, or '\n' when nothing is left.
Write(char)
Section titled “Write(char)”Writes to the destination, without touching the prefix.
protected virtual void Write(char value)Parameters
Section titled “Parameters”valuechar
Write(string)
Section titled “Write(string)”Writes to the destination, without touching the prefix.
protected virtual void Write(string value)Parameters
Section titled “Parameters”valuestring