Documentation ¶
Index ¶
Constants ¶
const ( BoxBottomLeft = "└" // \u2514 BOX DRAWINGS LIGHT UP AND RIGHT BoxBottomLeftBold = "┗" // \u2517 BOX DRAWINGS HEAVY UP AND RIGHT BoxBottomLeftDouble = "╚" // \u255A BOX DRAWINGS DOUBLE UP AND RIGHT BoxBottomLeftRounded = "╰" // \u2570 BOX DRAWINGS LIGHT ARC UP AND RIGHT BoxBottomRight = "┘" // \u2518 BOX DRAWINGS LIGHT UP AND LEFT BoxBottomRightBold = "┛" // \u251B BOX DRAWINGS HEAVY UP AND LEFT BoxBottomRightDouble = "╝" // \u255D BOX DRAWINGS DOUBLE UP AND LEFT BoxBottomRightRounded = "╯" // \u256F BOX DRAWINGS LIGHT ARC UP AND LEFT BoxBottomSeparator = "┴" // \u2534 BOX DRAWINGS LIGHT UP AND HORIZONTAL BoxBottomSeparatorBold = "┻" // \u253B BOX DRAWINGS HEAVY UP AND HORIZONTAL BoxBottomSeparatorDouble = "╩" // \u2569 BOX DRAWINGS DOUBLE UP AND HORIZONTAL BoxHorizontal = "─" // \u2500 BOX DRAWINGS LIGHT HORIZONTAL BoxHorizontalBold = "━" // \u2501 BOX DRAWINGS HEAVY HORIZONTAL BoxHorizontalDouble = "═" // \u2550 BOX DRAWINGS DOUBLE HORIZONTAL BoxLeft = BoxVertical BoxLeftBold = BoxVerticalBold BoxLeftDouble = BoxVerticalDouble BoxLeftSeparator = "├" // \u251C BOX DRAWINGS LIGHT VERTICAL AND RIGHT BoxLeftSeparatorBold = "┣" // \u2523 BOX DRAWINGS HEAVY VERTICAL AND RIGHT BoxLeftSeparatorDouble = "╠" // \u2560 BOX DRAWINGS DOUBLE VERTICAL AND RIGHT BoxRight = BoxVertical BoxRightBold = BoxVerticalBold BoxRightDouble = BoxVerticalDouble BoxRightSeparator = "┤" // \u2524 BOX DRAWINGS LIGHT VERTICAL AND LEFT BoxRightSeparatorBold = "┫" // \u252B BOX DRAWINGS HEAVY VERTICAL AND LEFT BoxRightSeparatorDouble = "╣" // \u2563 BOX DRAWINGS DOUBLE VERTICAL AND LEFT BoxSeparator = "┼" // \u253C BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL BoxSeparatorBold = "╋" // \u254B BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL BoxSeparatorDouble = "╬" // \u256C BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL BoxTopLeft = "┌" // \u250C BOX DRAWINGS LIGHT DOWN AND RIGHT BoxTopLeftBold = "┏" // \u250F BOX DRAWINGS HEAVY DOWN AND RIGHT BoxTopLeftDouble = "╔" // \u2554 BOX DRAWINGS DOUBLE DOWN AND RIGHT BoxTopLeftRounded = "╭" // \u256D BOX DRAWINGS LIGHT ARC DOWN AND RIGHT BoxTopRight = "┐" // \u2510 BOX DRAWINGS LIGHT DOWN AND LEFT BoxTopRightBold = "┓" // \u2513 BOX DRAWINGS HEAVY DOWN AND LEFT BoxTopRightDouble = "╗" // \u2557 BOX DRAWINGS DOUBLE DOWN AND LEFT BoxTopRightRounded = "╮" // \u256E BOX DRAWINGS LIGHT ARC DOWN AND LEFT BoxTopSeparator = "┬" // \u252C BOX DRAWINGS LIGHT DOWN AND HORIZONTAL BoxTopSeparatorBold = "┳" // \u2533 BOX DRAWINGS HEAVY DOWN AND HORIZONTAL BoxTopSeparatorDouble = "╦" // \u2566 BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL BoxUnfinishedLine = "≈" // \u2248 ALMOST EQUAL TO BoxVertical = "│" // \u2502 BOX DRAWINGS LIGHT VERTICAL BoxVerticalBold = "┃" // \u2503 BOX DRAWINGS HEAVY VERTICAL BoxVerticalDouble = "║" // \u2551 BOX DRAWINGS DOUBLE VERTICAL BulletCircle = "●" // \u25CF BLACK CIRCLE BulletFlower = "✽" // \u273D HEAVY TEARDROP-SPOKED ASTERISK BulletSquare = "■" // \u25A0 BLACK SQUARE BulletStar = "★" // \u272E BLACK STAR BulletTrianglePointingDown = "▼" // \u25BC BLACK DOWN-POINTING TRIANGLE BulletTrianglePointingLeft = "◀" // \u25C0 BLACK LEFT-POINTING TRIANGLE BulletTrianglePointingRight = "▶" // \u25B6 BLACK RIGHT-POINTING TRIANGLE BulletTrianglePointingTop = "▲" // \u25B2 BLACK UP-POINTING TRIANGLE )
Unicode character constants for drawing borders & separators.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Align ¶
type Align int
Align denotes how text is to be aligned horizontally.
const ( AlignDefault Align = iota // same as AlignLeft AlignLeft // "left " AlignCenter // " center " AlignJustify // "justify it" AlignRight // " right" )
Align enumerations
func (Align) Apply ¶
Apply aligns the text as directed. Examples:
- AlignDefault.Apply("Jon Snow", 12) returns "Jon Snow "
- AlignLeft.Apply("Jon Snow", 12) returns "Jon Snow "
- AlignCenter.Apply("Jon Snow", 12) returns " Jon Snow "
- AlignJustify.Apply("Jon Snow", 12) returns "Jon Snow"
- AlignRight.Apply("Jon Snow", 12) returns " Jon Snow"
func (Align) HTMLProperty ¶
HTMLProperty returns the equivalent HTML horizontal-align tag property.
func (Align) MarkdownProperty ¶
MarkdownProperty returns the equivalent Markdown horizontal-align separator.
type Color ¶
type Color int
Color represents a single color to render text with.
const ( Reset Color = iota Bold Faint Italic Underline BlinkSlow BlinkRapid ReverseVideo Concealed CrossedOut )
Base colors -- attributes in reality
Foreground text colors
const ( FgHiBlack Color = iota + 90 FgHiRed FgHiGreen FgHiYellow FgHiBlue FgHiMagenta FgHiCyan FgHiWhite )
Foreground Hi-Intensity text colors
Background text colors
const ( BgHiBlack Color = iota + 100 BgHiRed BgHiGreen BgHiYellow BgHiBlue BgHiMagenta BgHiCyan BgHiWhite )
Background Hi-Intensity text colors
func (Color) GetEscapeSeq ¶
GetEscapeSeq returns the ANSI escape sequence for the color.
type Colors ¶
type Colors []Color
Colors represents an array of Color objects to render text with. Example: Colors{FgCyan, BgBlack}
func (Colors) GetEscapeSeq ¶
GetEscapeSeq returns the ANSI escape sequence for the colors set.
type Format ¶
type Format int
Format denotes the "case" to use for text.
type VAlign ¶
type VAlign int
VAlign denotes how text is to be aligned vertically.
const ( VAlignDefault VAlign = iota // same as VAlignTop VAlignTop // "top\n\n" VAlignMiddle // "\nmiddle\n" VAlignBottom // "\n\nbottom" )
VAlign enumerations
func (VAlign) Apply ¶
Apply aligns the lines vertically. Examples:
- VAlignTop.Apply({"Game", "Of", "Thrones"}, 5) returns {"Game", "Of", "Thrones", "", ""}
- VAlignMiddle.Apply({"Game", "Of", "Thrones"}, 5) returns {"", "Game", "Of", "Thrones", ""}
- VAlignBottom.Apply({"Game", "Of", "Thrones"}, 5) returns {"", "", "Game", "Of", "Thrones"}
func (VAlign) ApplyStr ¶
ApplyStr aligns the string (of 1 or more lines) vertically. Examples:
- VAlignTop.ApplyStr("Game\nOf\nThrones", 5) returns {"Game", "Of", "Thrones", "", ""}
- VAlignMiddle.ApplyStr("Game\nOf\nThrones", 5) returns {"", "Game", "Of", "Thrones", ""}
- VAlignBottom.ApplyStr("Game\nOf\nThrones", 5) returns {"", "", "Game", "Of", "Thrones"}
func (VAlign) HTMLProperty ¶
HTMLProperty returns the equivalent HTML vertical-align tag property.