Documentation
¶
Index ¶
- Variables
- type Box
- func (b *Box) FootLeft() rune
- func (b *Box) FootRight() rune
- func (b *Box) FootVertical() rune
- func (b *Box) GetBottom(widths []int) string
- func (b *Box) GetPlainHeadedBox() *Box
- func (b *Box) GetRow(widths []int, level string) string
- func (b *Box) GetTop(widths []int) string
- func (b *Box) HeadLeft() rune
- func (b *Box) HeadRight() rune
- func (b *Box) HeadRowCross() rune
- func (b *Box) HeadRowH() rune
- func (b *Box) HeadRowLeft() rune
- func (b *Box) HeadRowRight() rune
- func (b *Box) HeadVertical() rune
- func (b *Box) MidLeft() rune
- func (b *Box) MidRight() rune
- func (b *Box) MidVertical() rune
- func (b *Box) NoEdge() *Box
- func (b *Box) String() string
- func (b *Box) Substitute(opts console.Options) *Box
Constants ¶
This section is empty.
Variables ¶
var ( ASCII = NewBox( "+--+\n"+ "| ||\n"+ "|-+|\n"+ "| ||\n"+ "|-+|\n"+ "|-+|\n"+ "| ||\n"+ "+--+\n", true, ) ASCII2 = NewBox( "+-++\n"+ "| ||\n"+ "+-++\n"+ "| ||\n"+ "+-++\n"+ "+-++\n"+ "| ||\n"+ "+-++\n", true, ) ASCII_DOUBLE_HEAD = NewBox( "+-++\n"+ "| ||\n"+ "+=++\n"+ "| ||\n"+ "+-++\n"+ "+-++\n"+ "| ||\n"+ "+-++\n", true, ) SQUARE = NewBox( "┌─┬┐\n"+ "│ ││\n"+ "├─┼┤\n"+ "│ ││\n"+ "├─┼┤\n"+ "├─┼┤\n"+ "│ ││\n"+ "└─┴┘\n", false, ) SQUARE_DOUBLE_HEAD = NewBox( "┌─┬┐\n"+ "│ ││\n"+ "╞═╪╡\n"+ "│ ││\n"+ "├─┼┤\n"+ "├─┼┤\n"+ "│ ││\n"+ "└─┴┘\n", false, ) MINIMAL = NewBox( " ╷ \n"+ " │ \n"+ "╶─┼╴\n"+ " │ \n"+ "╶─┼╴\n"+ "╶─┼╴\n"+ " │ \n"+ " ╵ \n", false, ) MINIMAL_HEAVY_HEAD = NewBox( " ╷ \n"+ " │ \n"+ "╺━┿╸\n"+ " │ \n"+ "╶─┼╴\n"+ "╶─┼╴\n"+ " │ \n"+ " ╵ \n", false, ) MINIMAL_DOUBLE_HEAD = NewBox( " ╷ \n"+ " │ \n"+ " ═╪ \n"+ " │ \n"+ " ─┼ \n"+ " ─┼ \n"+ " │ \n"+ " ╵ \n", false, ) SIMPLE = NewBox( " \n"+ " \n"+ " ── \n"+ " \n"+ " \n"+ " ── \n"+ " \n"+ " \n", false, ) SIMPLE_HEAD = NewBox( " \n"+ " \n"+ " ── \n"+ " \n"+ " \n"+ " \n"+ " \n"+ " \n", false, ) SIMPLE_HEAVY = NewBox( " \n"+ " \n"+ " ━━ \n"+ " \n"+ " \n"+ " ━━ \n"+ " \n"+ " \n", false, ) HORIZONTALS = NewBox( " ── \n"+ " \n"+ " ── \n"+ " \n"+ " ── \n"+ " ── \n"+ " \n"+ " ── \n", false, ) ROUNDED = NewBox( "╭─┬╮\n"+ "│ ││\n"+ "├─┼┤\n"+ "│ ││\n"+ "├─┼┤\n"+ "├─┼┤\n"+ "│ ││\n"+ "╰─┴╯\n", false, ) HEAVY = NewBox( "┏━┳┓\n"+ "┃ ┃┃\n"+ "┣━╋┫\n"+ "┃ ┃┃\n"+ "┣━╋┫\n"+ "┣━╋┫\n"+ "┃ ┃┃\n"+ "┗━┻┛\n", false, ) HEAVY_EDGE = NewBox( "┏━┯┓\n"+ "┃ │┃\n"+ "┠─┼┨\n"+ "┃ │┃\n"+ "┠─┼┨\n"+ "┠─┼┨\n"+ "┃ │┃\n"+ "┗━┷┛\n", false, ) HEAVY_HEAD = NewBox( "┏━┳┓\n"+ "┃ ┃┃\n"+ "┡━╇┩\n"+ "│ ││\n"+ "├─┼┤\n"+ "├─┼┤\n"+ "│ ││\n"+ "└─┴┘\n", false, ) DOUBLE = NewBox( "╔═╦╗\n"+ "║ ║║\n"+ "╠═╬╣\n"+ "║ ║║\n"+ "╠═╬╣\n"+ "╠═╬╣\n"+ "║ ║║\n"+ "╚═╩╝\n", false, ) DOUBLE_EDGE = NewBox( "╔═╤╗\n"+ "║ │║\n"+ "╟─┼╢\n"+ "║ │║\n"+ "╟─┼╢\n"+ "╟─┼╢\n"+ "║ │║\n"+ "╚═╧╝\n", false, ) MARKDOWN = NewBox( " \n"+ "| ||\n"+ "|-||\n"+ "| ||\n"+ "|-||\n"+ "|-||\n"+ "| ||\n"+ " \n", true, ) )
Functions ¶
This section is empty.
Types ¶
type Box ¶
type Box struct {
// contains filtered or unexported fields
}
Box defines characters for drawing table borders.
The layout uses 8 lines of 4 characters each:
┌─┬┐ top │ ││ head ├─┼┤ head_row │ ││ mid ├─┼┤ row ├─┼┤ foot_row │ ││ foot └─┴┘ bottom
func (*Box) FootVertical ¶
FootVertical returns the vertical divider character for the footer row.
func (*Box) GetPlainHeadedBox ¶
GetPlainHeadedBox returns an equivalent box without special header characters.
func (*Box) GetRow ¶
GetRow builds a horizontal divider line for the given column widths. level must be one of "head", "row", "foot", or "mid".
func (*Box) HeadRowCross ¶
HeadRowCross returns the cross character for a head row divider.
func (*Box) HeadRowLeft ¶
HeadRowLeft returns the left edge character for a head row divider.
func (*Box) HeadRowRight ¶
HeadRowRight returns the right edge character for a head row divider.
func (*Box) HeadVertical ¶
HeadVertical returns the vertical divider character for the header row.
func (*Box) MidVertical ¶
MidVertical returns the vertical divider character for mid (data) rows.