Markup Class

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

Attributes

SuppressMessageAttribute

Constructors

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

Properties

Justify? Justification
Gets or sets the justification.
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(RenderOptions, int)
Measures the renderable object.
static string Remove(string)
Removes markup from the specified string.
protected override IEnumerable<Segment> Render(RenderOptions, int)
Renders the object.

Extension Methods

T Centered<Markup>()
Sets the IHasJustification 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 Justify<Markup>(Justify?)
Sets the justification for an IHasJustification object.
T LeftJustified<Markup>()
Sets the IHasJustification object to be left justified.
T Overflow<Markup>(Overflow)
Sets the overflow strategy.
T RightJustified<Markup>()
Sets the IHasJustification object to be right justified.