RendererBase Class

Base class for a IMarkdownRenderer.

public abstract class RendererBase : IMarkdownRenderer
Implements

Constructors

NameDescription
RendererBase()Initializes a new instance of the RendererBase class.

RendererBase()

RendererBase.cs

Initializes a new instance of the RendererBase class.

protected RendererBase()

Properties

NameDescription
IsFirstInContainerGets or sets the is first in container.
IsLastInContainerGets or sets the is last in container.
MaximumNestingDepthGets or sets the maximum nesting depth allowed while rendering Markdown objects.
ObjectRenderersGets the object renderers.

IsFirstInContainer

RendererBase.cs

Gets or sets the is first in container.

public bool IsFirstInContainer { get; }

Property value

bool

IsLastInContainer

RendererBase.cs

Gets or sets the is last in container.

public bool IsLastInContainer { get; }

Property value

bool

MaximumNestingDepth

RendererBase.cs

Gets or sets the maximum nesting depth allowed while rendering Markdown objects.

public int MaximumNestingDepth { get; set; }

Property value

int

Exceptions

ArgumentOutOfRangeException
Thrown when the value is less than or equal to zero.

Remarks

The default value is 128. Raising this value allows deeper documents but can increase rendering stack usage.

ObjectRenderers

RendererBase.cs

Gets the object renderers.

public ObjectRendererCollection ObjectRenderers { get; }

Methods

NameDescription
Render(MarkdownObject)Performs the render operation.
Write(MarkdownObject)Writes the specified Markdown object.
WriteChildren(ContainerBlock)Writes the children of the specified ContainerBlock.
WriteChildren(ContainerInline)Writes the children of the specified ContainerInline.

Render(MarkdownObject)

Performs the render operation.

public abstract object Render(MarkdownObject markdownObject)

Parameters

markdownObject MarkdownObject

Returns

object

Write(MarkdownObject)

RendererBase.cs

Writes the specified Markdown object.

public void Write(MarkdownObject obj)

Parameters

obj MarkdownObject
The Markdown object to write to this renderer.

WriteChildren overloads

WriteChildren(ContainerBlock)

RendererBase.cs

Writes the children of the specified ContainerBlock.

public void WriteChildren(ContainerBlock containerBlock)
Parameters
containerBlock ContainerBlock
The container block.

WriteChildren(ContainerInline)

RendererBase.cs

Writes the children of the specified ContainerInline.

public void WriteChildren(ContainerInline containerInline)
Parameters
containerInline ContainerInline
The container inline.

Events

NameDescription
ObjectWriteAfterOccurs after writing an object.
ObjectWriteBeforeOccurs before writing an object.

ObjectWriteAfter

Occurs after writing an object.

public event Action<IMarkdownRenderer, MarkdownObject>? ObjectWriteAfter

ObjectWriteBefore

Occurs before writing an object.

public event Action<IMarkdownRenderer, MarkdownObject>? ObjectWriteBefore