Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

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

Declaration

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

Summary

Generates a sequence of ConsoleColoredStrings from a CuteML 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 CuteML parse tree.

Remarks

The following CuteML tags are processed:

  • [<color>:...] = use the specified console color, for example [<darkred>:...].
  • [*blah] = Brightens the current color, for example turning dark-red into red or light-gray into white.
  • [-blah] = Darkens the current color, for example turning red into dark-red or white into light-gray.
  • [.blah] = Creates a bullet point. Surround a whole paragraph with this to add the bullet point and indent the paragraph. Use this to create bulleted lists. The default bullet point character is *; you can use an attribute to specify another one, for example [<->.blah].
  • [+blah] = Suppresses 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.

Text which is not inside a color tag defaults to light gray.