Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Method: IEnumerable<ConsoleColoredString> ToConsoleColoredStringWordWrap(int, int)

Declaration

public IEnumerable<ConsoleColoredString> ToConsoleColoredStringWordWrap(
    int wrapWidth,
    int hangingIndent = 0
)

Summary

Generates a sequence of ConsoleColoredStrings from an EggsML parse tree by word-wrapping the output at a specified character width.

Parameters

intwrapWidth The number of characters at which to word-wrap the output.
inthangingIndent The number of spaces to add to each line except the first of each paragraph, thus creating a hanging indentation.

Returns

The sequence of ConsoleColoredStrings generated from the EggsML parse tree.

Remarks

The following EggsML tags map to the following console colors:

  • ~ = black, or dark gray if inside a * tag
  • / = dark blue, or blue if inside a * tag
  • $ = dark green, or green if inside a * tag
  • & = dark cyan, or cyan if inside a * tag
  • _ = dark red, or red if inside a * tag
  • % = dark magenta, or magenta if inside a * tag
  • ^ = dark yellow, or yellow if inside a * tag
  • = = dark gray (independent of * tag)

Text which is not inside any of the above color tags defaults to light gray, or white if inside a * tag.

Additionally, the + tag can be used to suppress word-wrapping within a certain stretch of text. In other words, the contents of a + tag are treated as if they were a single word. Use this in preference to U+00A0 (no-break space) as it is more explicit and more future-compatible in case hyphenation is ever implemented here.