render

fun render(message: Any?, whitespace: Whitespace = Whitespace.PRE, align: TextAlign = TextAlign.NONE, overflowWrap: OverflowWrap = OverflowWrap.NORMAL, width: Int? = null): String

Render a message to a string.

Any contained TextColors and TextStyles will be automatically downsampled based on the current terminal's info.

Parameters

message

The message to render as a string.

whitespace

How to handle whitespace and line wrapping. By default, whitespace is printed unchanged and lines are not wrapped.

align

How to align text in the terminal. By default, no alignment is performed.

overflowWrap

How to wrap words longer than a single line. By default, long words are not wrapped.

width

The width to wrap to if whitespace or overflowWrap are set. By default, this will use info.width


fun render(widget: Widget): String

Render a widget as a string