Markup Class

A renderable piece of markup text.
[SuppressMessage("Naming", "CA1724:Type names should not match namespaces")]
public sealed class Markup : Renderable, IRenderable, IAlignable, IOverflowable

Attributes

SuppressMessageAttribute

Constructors

Markup(string, Style)
Initializes a new instance of the Markup class.

Properties

Justify? Alignment
Gets or sets the alignment.
int Length
Gets the character count.
int Lines
Gets the number of lines.
Overflow? Overflow
Gets or sets the text overflow strategy.

Methods

static string Escape(string)
Escapes text so that it won’t be interpreted as markup.
static Markup FromInterpolated(FormattableString, Style)
Returns a new instance of a Markup widget from an interpolated string.
static Markup FromInterpolated(IFormatProvider, FormattableString, Style)
Returns a new instance of a Markup widget from an interpolated string.
protected override Measurement Measure(RenderContext, int)
Measures the renderable object.
static string Remove(string)
Removes markup from the specified string.
protected override IEnumerable<Segment> Render(RenderContext, int)
Renders the object.

Extension Methods

T Alignment<Markup>(Justify?)
Sets the alignment for an IAlignable object.
T Centered<Markup>()
Sets the IAlignable object to be centered.
T Crop<Markup>()
Crops any overflowing text.
T Ellipsis<Markup>()
Crops any overflowing text and adds an ellipsis to the end.
T Fold<Markup>()
Folds any overflowing text.
IEnumerable<Segment> GetSegments(IAnsiConsole)
Gets the segments for a renderable using the specified console.
T LeftAligned<Markup>()
Sets the IAlignable object to be left aligned.
T Overflow<Markup>(Overflow)
Sets the overflow strategy.
T RightAligned<Markup>()
Sets the IAlignable object to be right aligned.