Skip to content
ConsoleMonster

API Reference

Class

StyledText

Namespace ConsoleMonster.Text
Assembly ConsoleMonster
Modifiers sealed

Multi-line styled text: the result of parsing markup or splitting plain text into lines.

Inheritance

  • Object
  • StyledText

Usage

Explore 7 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 1

Constructors

public StyledText(IReadOnlyList<StyledLine> lines) #

Creates styled text from lines.

Parameters

lines System.Collections.Generic.IReadOnlyList<ConsoleMonster.Text.StyledLine> requiredposition: 0
The lines.

Methods

public static StyledText FromPlain(String? text, Style style = default) #
Returns: StyledText

Splits plain text (no markup) into lines with one style.

Parameters

text System.String? requiredposition: 0
The text; \r\n, \n and \r separate lines.
style ConsoleMonster.Styling.Style = default optionalposition: 1
The style.

Returns

Styled text.

public static StyledText FromSpans(IEnumerable<TextSpan> spans) #
Returns: StyledText

Creates styled text from spans that may contain line breaks.

Parameters

spans System.Collections.Generic.IEnumerable<ConsoleMonster.Text.TextSpan> requiredposition: 0
The spans.

Returns

Styled text.

Properties

public IReadOnlyList<StyledLine> Lines { get; } #

The lines.

public Int32 Width { get; } #

The widest line in cells.