### Install go-pretty Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6 Use 'go get' to install the latest version of the go-pretty library. ```bash go get github.com/jedib0t/go-pretty/v6 ``` -------------------------------- ### Tracker Start Method Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress Start begins the tracking process for cases where DeferStart is set to false. Added in v6.4.7. ```go func (t *Tracker) Start() ``` -------------------------------- ### Table Rendering Example Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/table Demonstrates how to render a table in a human-readable pretty format. This example shows a basic table with headers and data rows. ```go ┌─────┬────────────┬───────────┬────────┬─────────────────────────────┐ │ # │ FIRST NAME │ LAST NAME │ SALARY │ │ ├─────┼────────────┼───────────┼────────┼─────────────────────────────┤ │ 1 │ Arya │ Stark │ 3000 │ │ │ 20 │ Jon │ Snow │ 2000 │ You know nothing, Jon Snow! │ ``` -------------------------------- ### Default and Example Color Styles Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress Defines default color settings and an example of custom color configurations for progress trackers. ```go var ( // StyleColorsDefault defines sane color choices - None. StyleColorsDefault = StyleColors{} // StyleColorsExample defines a few choice color options. Use this is just // as an example to customize the Tracker/text colors. StyleColorsExample = StyleColors{ Message: text.Colors{text.FgWhite}, Error: text.Colors{text.FgRed}, Percent: text.Colors{text.FgHiRed}, Pinned: text.Colors{text.BgHiBlack, text.FgWhite, text.Bold}, Stats: text.Colors{text.FgHiBlack}, Time: text.Colors{text.FgGreen}, Tracker: text.Colors{text.FgYellow}, Value: text.Colors{text.FgCyan}, Speed: text.Colors{text.FgMagenta}, } ) ``` -------------------------------- ### Table Rendering Examples Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/table Demonstrates how to render tables with and without styling using the go-pretty library. ```APIDOC ## Table Rendering Examples ### Simple Table Output This example shows a basic table without any customizations. ``` +-----+------------+-----------+--------+-----------------------------+ | # | FIRST NAME | LAST NAME | SALARY | | +-----+------------+-----------+--------+-----------------------------+ | 1 | Arya | Stark | 3000 | | | 20 | Jon | Snow | 2000 | You know nothing, Jon Snow! | | 300 | Tyrion | Lannister | 5000 | | +-----+------------+-----------+--------+-----------------------------+ | | | TOTAL | 10000 | | +-----+------------+-----------+--------+-----------------------------+ ``` ### Styled Table Output This example demonstrates a table with various customizations and styling applied. ``` ┌──────────────────────────────────────────────────────────────────────┐ │ first name last name salary │ ├──────────────────────────────────────────────────────────────────────┤ │ 1 arya stark 3000 a girl has no name. │ │ 2 sansa stark 4000 │ │ 3 jon snow 2000 you know nothing, jon snow! │ │ 4 jaime lannister 5000 │ │ 5 tyrion lannister 5000 a lannister always pays his debts. │ ├──────────────────────────────────────────────────────────────────────┤ │ total 10000 │ └──────────────────────────────────────────────────────────────────────┘ ``` ``` -------------------------------- ### RenderHTML Example Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/list An example of how the list is rendered in HTML format, showcasing nested unordered lists with specific CSS classes for styling. ```html ``` -------------------------------- ### Tracker.Start Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/progress Marks the tracker as started. ```APIDOC ## func (t *Tracker) Start() ### Description Marks the tracker as started. ``` -------------------------------- ### Simple List Example Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/cmd/demo-list Renders a basic, single-level bulleted list. Suitable for straightforward itemizations. ```go A Simple List: -------------- * Game Of Thrones * The Dark Tower ``` -------------------------------- ### Run 256-Color Palette Demo Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/cmd/demo-colors Execute the demo to see the 256-color ANSI palette in action. Ensure you have the go-pretty package installed. ```bash go run ./cmd/demo-colors ``` -------------------------------- ### Simple List Output Example Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/list Demonstrates the default rendering of a hierarchical list structure. This output is generated by the go-pretty library. ```text Output: Simple List: ├ George. R. R. Martin │ └─ A Song Of Ice And Fire │ ├─ Arya Stark │ ├─ Bran Stark │ ├─ Rickon Stark │ ├─ Robb Stark │ ├─ Sansa Stark │ └─ Jon Snow └─ Stephen King ├─ The Dark Tower │ ├─ Jake Chambers │ ├─ Randal Flagg │ └─ Roland Deschain └─ The Shawshank Redemption ├─ Andy Dufresne ├─ Byron Hadley ├─ Ellis Boyd Redding └─ Samuel Norton ``` -------------------------------- ### Format Apply Method Example Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/text Demonstrates the Apply method of the Format type, showing text transformations with and without ANSI escape sequences. ```text Output: FormatDefault: "jon Snow" FormatLower : "jon snow" FormatTitle : "Jon Snow" FormatUpper : "JON SNOW" FormatDefault (w/EscSeq): "\x1b[1mjon Snow\x1b[0m" FormatLower (w/EscSeq): "\x1b[1mjon snow\x1b[0m" FormatTitle (w/EscSeq): "\x1b[1mJon Snow\x1b[0m" FormatUpper (w/EscSeq): "\x1b[1mJON SNOW\x1b[0m" ``` -------------------------------- ### VAlign Apply Method Example Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/text Demonstrates the Apply method of VAlign, showing how lines are vertically aligned to fit a maximum number of lines. ```text Output: VAlignDefault: []string{"Game", "Of", "Thrones", "", ""} VAlignTop : []string{"Game", "Of", "Thrones", "", ""} VAlignMiddle : []string{"", "Game", "Of", "Thrones", ""} VAlignBottom : []string{"", "", "Game", "Of", "Thrones"} ``` -------------------------------- ### Auto Index Column ID Examples Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/table Examples demonstrating the output of AutoIndexColumnID for various column indices, mimicking Excel's column naming convention. ```text Output: AutoIndexColumnID( 0): "A" AutoIndexColumnID( 1): "B" AutoIndexColumnID( 2): "C" AutoIndexColumnID( 25): "Z" AutoIndexColumnID( 26): "AA" AutoIndexColumnID( 702): "AAA" AutoIndexColumnID(18278): "AAAA" ``` -------------------------------- ### SortBy Enum Example Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress Illustrates the SortBy enumeration used for sorting progress trackers. ```go // SortByValueDsc sorts by the Value in descending order. SortByValueDsc ``` -------------------------------- ### Run Table Colors Demo Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6 Execute the table demo command to see colored table outputs. This requires the go-pretty CLI tools to be installed. ```bash go run github.com/jedib0t/go-pretty/v6/cmd/demo-table@latest colors ``` -------------------------------- ### NewWriter Function Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/list Initializes and returns a new `Writer` instance. This is the primary function to call to start creating and rendering lists. ```go func NewWriter() Writer ``` -------------------------------- ### Example List Rendering Output Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/list Demonstrates the visual output of a hierarchical list rendered with the go-pretty library, showcasing nested items and different branches. ```text Output: Simple List: ├ George. R. R. Martin │ └─ A Song Of Ice And Fire │ ├ Arya Stark │ ├ Bran Stark │ ├ Rickon Stark │ ├ Robb Stark │ ├ Sansa Stark │ └ Jon Snow └─ Stephen King ├─ The Dark Tower │ ├ Jake Chambers │ ├ Randal Flagg │ └ Roland Deschain └─ The Shawshank Redemption ├ Andy Dufresne ├ Byron Hadley ├ Ellis Boyd Redding └ Samuel Norton ``` -------------------------------- ### WrapSoft Function Example Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/text Demonstrates how WrapSoft handles string wrapping with ANSI escape sequences, preserving formatting while moving words to new lines. ```go func WrapSoft(str string, wrapLen int) string ``` -------------------------------- ### Sample Table Rendering Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/table Demonstrates the visual output of a rendered table with headers, rows, and a footer. This example shows a basic table structure and content. ```text +---------------------------------------------------------------------+ | Game of Thrones + +-----+------------+-----------+--------+-----------------------------+ | # | FIRST NAME | LAST NAME | SALARY | | +-----+------------+-----------+--------+-----------------------------+ | 1 | Arya | Stark | 3000 | | | 20 | Jon | Snow | 2000 | You know nothing, Jon Snow! | | 300 | Tyrion | Lannister | 5000 | | +-----+------------+-----------+--------+-----------------------------+ | | | TOTAL | 10000 | | +-----+------------+-----------+--------+-----------------------------+ ``` -------------------------------- ### Tracker.IsStarted Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/progress Checks if the tracker has been started. ```APIDOC ## func (t *Tracker) IsStarted() bool ### Description Checks if the tracker has been started. ### Returns * (bool) - True if the tracker has started, false otherwise. ``` -------------------------------- ### Pretty-print ASCII Table Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6 Example of a formatted ASCII table generated by go-pretty. This demonstrates the visual output of the table package. ```text +-----+------------+-----------+--------+-----------------------------+ | # | FIRST NAME | LAST NAME | SALARY | | +-----+------------+-----------+--------+-----------------------------+ | 1 | Arya | Stark | 3000 | | | 20 | Jon | Snow | 2000 | You know nothing, Jon Snow! | | 300 | Tyrion | Lannister | 5000 | | +-----+------------+-----------+--------+-----------------------------+ | | | TOTAL | 10000 | | +-----+------------+-----------+--------+-----------------------------+ ``` -------------------------------- ### Align.Apply Method Example Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/text Illustrates the Apply method of the Align type, demonstrating how different alignment settings affect text within a specified maximum length. ```go func (a Align) Apply(text string, maxLength int) string // Example: // * 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" // * AlignAuto.Apply("Jon Snow", 12) returns "Jon Snow " // * AlignAuto.Apply(" -5.43", 12) returns " -5.43" ``` -------------------------------- ### WrapText Function Example Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/text Shows WrapText's behavior, which is similar to WrapHard but also respects existing line breaks in the input string. ```go func WrapText(str string, wrapLen int) string ``` -------------------------------- ### Pretty-print Hierarchical List Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6 Example of a formatted hierarchical list generated by go-pretty. This demonstrates indentation and structure for nested items. ```text ╭─ Game Of Thrones │ ├─ Winter │ ├─ Is │ ╰─ Coming │ ├─ This │ ├─ Is │ ╰─ Known ╰─ The Dark Tower ╰─ The Gunslinger ``` -------------------------------- ### Align.MarkdownProperty Method Example Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/text Demonstrates the MarkdownProperty method of the Align type, returning the equivalent Markdown horizontal-align separator, with an option to specify minimum length. ```go func (a Align) MarkdownProperty(minLength ...int) string ``` -------------------------------- ### Default Style Visibility Options Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress Use StyleVisibilityDefault as a starting point for customizing tracker rendering options. ```go var StyleVisibilityDefault = StyleVisibility{ ETA: false, ETAOverall: true, Percentage: true, Pinned: true, Speed: false, SpeedOverall: false, Time: true, Tracker: true, TrackerOverall: false, Value: true, } ``` -------------------------------- ### Align.HTMLProperty Method Example Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/text Shows the HTMLProperty method of the Align type, which returns the corresponding HTML horizontal-align tag property. ```go func (a Align) HTMLProperty() string ``` -------------------------------- ### Example Usage of AutoIndexColumnID Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/table Demonstrates the output of AutoIndexColumnID for various integer inputs, illustrating the Excel-like column naming. ```text Output: AutoIndexColumnID( 0): "A" AutoIndexColumnID( 1): "B" AutoIndexColumnID( 2): "C" AutoIndexColumnID( 25): "Z" AutoIndexColumnID( 26): "AA" AutoIndexColumnID( 702): "AAA" AutoIndexColumnID(18278): "AAAA" ``` -------------------------------- ### Apply Text Formatting Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/text Converts the text to the specified format (default, lower, title, upper), preserving escape sequences. Includes examples with and without escape sequences. ```go func (tc Format) Apply(text string) string ``` ```text Output: FormatDefault: "jon Snow" FormatLower : "jon snow" FormatTitle : "Jon Snow" FormatUpper : "JON SNOW" FormatDefault (w/EscSeq): "\x1b[1mjon Snow\x1b[0m" FormatLower (w/EscSeq): "\x1b[1mjon snow\x1b[0m" FormatTitle (w/EscSeq): "\x1b[1mJon Snow\x1b[0m" FormatUpper (w/EscSeq): "\x1b[1mJON SNOW\x1b[0m" ``` -------------------------------- ### Multi-level List Example Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/cmd/demo-list Displays a nested list structure, ideal for representing hierarchical data. Indentation clearly defines parent-child relationships. ```go A Multi-level List: ------------------- * Game Of Thrones * Winter * Is * Coming * This * Is * Known * The Dark Tower * The Gunslinger ``` -------------------------------- ### Tracker Initialization and Usage Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/progress Instantiate a Tracker with a message, total, and units, then feed it to the Progress Writer. Use Increment to update progress. ```go Tracker helps track the progress of a single task. The way to use it is to instantiate a Tracker with a valid Message, a valid (expected) Total, and Units values. This should then be fed to the Progress Writer with the Writer.AppendTracker() method. When the task that is being done has progress, increment the value using the Tracker.Increment(value) method. ``` -------------------------------- ### LengthDone Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/progress Gets the number of trackers that have completed. ```APIDOC ## LengthDone ### Description LengthDone returns the number of Trackers that are done tracking. ### Method func (p *Progress) LengthDone() int ``` -------------------------------- ### Tracker IsStarted Method Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress IsStarted returns true if the tracker has begun tracking. It returns false if DeferStart is used and Start, Increment, IncrementWithError, or SetValue have not yet been called. Added in v6.4.7. ```go func (t *Tracker) IsStarted() bool ``` -------------------------------- ### LengthInQueue Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/progress Gets the number of trackers waiting to be processed. ```APIDOC ## LengthInQueue ### Description LengthInQueue returns the number of Trackers in queue to be actively tracked (not tracking yet). ### Method func (p *Progress) LengthInQueue() int ``` -------------------------------- ### LengthActive Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/progress Gets the number of currently active trackers. ```APIDOC ## LengthActive ### Description LengthActive returns the number of Trackers actively tracked (not done yet). ### Method func (p *Progress) LengthActive() int ``` -------------------------------- ### Length Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/progress Gets the total number of trackers being managed. ```APIDOC ## Length ### Description Length returns the number of Trackers tracked overall. ### Method func (p *Progress) Length() int ``` -------------------------------- ### EscSeqParser.IsOpen Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/text Checks if an escape sequence has been started but not yet completed. ```APIDOC ## EscSeqParser.IsOpen ### Description Checks if an escape sequence has been started but not yet completed. ### Method Signature func (s *EscSeqParser) IsOpen() bool ### Parameters #### Path Parameters - **s** (*EscSeqParser) - The escape sequence parser. ``` -------------------------------- ### Get Number of Trackers in Queue Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress LengthInQueue returns the count of trackers that are waiting to be processed. ```go func (p *Progress) LengthInQueue() int ``` -------------------------------- ### Import go-pretty Packages Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6 Import the necessary packages from go-pretty for table, list, progress, and text utilities. ```go import ( "github.com/jedib0t/go-pretty/v6/table" "github.com/jedib0t/go-pretty/v6/list" "github.com/jedib0t/go-pretty/v6/progress" "github.com/jedib0t/go-pretty/v6/text" ) ``` -------------------------------- ### Get Number of Completed Trackers Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress LengthDone returns the count of trackers that have successfully completed their tasks. ```go func (p *Progress) LengthDone() int ``` -------------------------------- ### Table with Header, Rows, and Footer Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/cmd/demo-table Constructs a table including a header, data rows, and a footer row. Useful for summaries or totals. ```go package main import ( "fmt" "github.com/jedib0t/go-pretty/v6/table" ) func main() { t t := table.NewWriter() t t.AppendHeader(&table.Row{"#", "FIRST NAME", "LAST NAME", "SALARY"}) t t.AppendRows([]interface{}{ table.Row{1, "Arya", "Stark", 3000}, table.Row{20, "Jon", "Snow", 2000}, table.Row{300, "Tyrion", "Lannister", 5000}, }) t t.AppendFooter(&table.Row{"", "", "TOTAL", 10000}) fmt.Println(t.Render()) ``` -------------------------------- ### Indeterminate Indicator Structure Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress Defines the structure for an indicator used in indeterminate progress displays. Example: {0, <=>}. ```go type IndeterminateIndicator struct { Position int Text string } ``` -------------------------------- ### Get Current Escape Sequence Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/text Returns the currently parsed escape sequence string. Added in v6.7.3. ```go func (s *EscSeqParser) Sequence() string ``` -------------------------------- ### Sample List Output Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/list Demonstrates the hierarchical structure and visual output of a pretty-printed list. ```text ■ Game Of Thrones ■ Winter ■ Is ■ Coming ■ This ■ Is ■ Known ■ The Dark Tower ■ The Gunslinger ``` -------------------------------- ### Get Active Codes from EscSeqParser Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/text Retrieves the active formatting codes tracked by the EscSeqParser. Added in v6.7.3. ```go func (s *EscSeqParser) Codes() []int ``` -------------------------------- ### Bright Color Options Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/table Sets up color options for rendering dark text on a bright background. ```go // ColorOptionsBright renders dark text on bright background. ColorOptionsBright = ColorOptionsBlackOnCyanWhite ``` -------------------------------- ### Get Number of Active Trackers Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress LengthActive returns the count of trackers that are currently being processed and have not yet finished. ```go func (p *Progress) LengthActive() int ``` -------------------------------- ### Get Total Number of Trackers Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress Length returns the total count of all trackers that have been managed by the Progress instance. ```go func (p *Progress) Length() int ``` -------------------------------- ### Check if EscSeqParser Sequence is Open Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/text Indicates whether an escape sequence has been started but not yet completed. Added in v6.7.3. ```go func (s *EscSeqParser) IsOpen() bool ``` -------------------------------- ### Reset Table Rows Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/table Clears all previously appended data rows from the table. Use this to start over with a fresh set of rows. ```go func (t *Table) ResetRows() ``` -------------------------------- ### Format Constants Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/text Enumerates different text formatting options including default, lower case, title case, and upper case. ```go const ( FormatDefault Format = iota // default_Case FormatLower // lower FormatTitle // Title FormatUpper // UPPER ) ``` -------------------------------- ### Render Method Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/list Renders the list into a human-readable, "pretty" text format. This method is suitable for console output or plain text displays. ```go func (l *List) Render() string ``` -------------------------------- ### Render Multi-level List Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/cmd/demo-list Shows how to create nested lists with indentation. Supports hierarchical data structures. ```go A Multi-level List: ------------------- * Game Of Thrones * Winter * Is * Coming * This * Is * Known * The Dark Tower * The Gunslinger ``` -------------------------------- ### Dark Color Options Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/table Sets up color options for rendering bright text on a dark background. ```go // ColorOptionsDark renders bright text on dark background. ColorOptionsDark = ColorOptionsCyanWhiteOnBlack ``` -------------------------------- ### Unit Formatting Options Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress Provides predefined unit formats for displaying values, including default, bytes, and currency. ```go var ( // UnitsDefault doesn't define any units. The value will be treated as any // other number. UnitsDefault = Units{ Notation: "", NotationPosition: UnitsNotationPositionBefore, Formatter: FormatNumber, } // UnitsBytes defines the value as a storage unit. Values will be converted // and printed in one of these forms: B, KB, MB, GB, TB, PB UnitsBytes = Units{ Notation: "", NotationPosition: UnitsNotationPositionBefore, Formatter: FormatBytes, } // UnitsCurrencyDollar defines the value as a Dollar amount. Values will be // converted and printed in one of these forms: $x.yz, $x.yzK, $x.yzM, // $x.yzB, $x.yzT UnitsCurrencyDollar = Units{ Notation: "$", NotationPosition: UnitsNotationPositionBefore, Formatter: FormatNumber, } // UnitsCurrencyEuro defines the value as a Euro amount. Values will be // converted and printed in one of these forms: ₠x.yz, ₠x.yzK, ₠x.yzM, // ₠x.yzB, ₠x.yzT UnitsCurrencyEuro = Units{ Notation: "₠", NotationPosition: UnitsNotationPositionBefore, Formatter: FormatNumber, } ) ``` -------------------------------- ### Get HTML Property for Color Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/text HTMLProperty returns the "class" attribute for the color, suitable for HTML output. ```go func (c Color) HTMLProperty() string ``` -------------------------------- ### Default Table Options Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/table Provides default configurations for table rendering. OptionsDefault sets up a table with borders and separators, while OptionsNoBorders and OptionsNoBordersAndSeparators disable these elements. ```go var ( // OptionsDefault defines sensible global options. OptionsDefault = Options{ DoNotColorBordersAndSeparators: false, DrawBorder: true, SeparateColumns: true, SeparateFooter: true, SeparateHeader: true, SeparateRows: false, } // OptionsNoBorders sets up a table without any borders. OptionsNoBorders = Options{ DoNotColorBordersAndSeparators: false, DrawBorder: false, SeparateColumns: true, SeparateFooter: true, SeparateHeader: true, SeparateRows: false, } // OptionsNoBordersAndSeparators sets up a table without any borders or // separators. OptionsNoBordersAndSeparators = Options{ DoNotColorBordersAndSeparators: false, DrawBorder: false, SeparateColumns: false, SeparateFooter: false, SeparateHeader: false, SeparateRows: false, } ) ``` -------------------------------- ### Get ANSI Escape Sequence for Color Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/text EscapeSeq returns the ANSI escape sequence for the color. This is used for terminal colorization. ```go func (c Color) EscapeSeq() string ``` -------------------------------- ### Format.Apply Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/text Applies the format to a string. ```APIDOC ## Format.Apply ### Description Applies the format to a string. This is a general formatting method. ### Method Signature func (tc Format) Apply(text string) string ### Parameters #### Path Parameters - **tc** (Format) - The format object. - **text** (string) - The string to format. ``` -------------------------------- ### Align.HTMLProperty: Get HTML Alignment Property Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/text Returns the corresponding HTML horizontal-align tag property string for a given Align value. ```go func (a Align) HTMLProperty() string ``` ```text Output: AlignDefault: '' AlignLeft : 'align="left"' AlignCenter : 'align="center"' AlignJustify: 'align="justify"' AlignRight : 'align="right"' ``` -------------------------------- ### Style Function Signature Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress Retrieves the current styling configuration of the progress tracker. ```go func (p *Progress) Style() *Style ``` -------------------------------- ### Render Simple List Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/cmd/demo-list Displays a basic bulleted list. This is the default behavior for simple lists. ```go A Simple List: -------------- * Game Of Thrones * The Dark Tower ``` -------------------------------- ### Get Current Table Style Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/table Retrieves the current Style object applied to the table. This can be useful for inspecting or modifying existing styles. ```go func (t *Table) Style() *Style ``` -------------------------------- ### Get Modifier Character for Text Direction Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6/text Returns a character to force the given direction for the text that follows the modifier. Added in v6.3.9. ```go func (d Direction) Modifier() string ``` -------------------------------- ### Default Progress Style Options Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress Sets the default style options for progress indicators, including strings for completion and errors, ETA precision, and speed formatting. ```go var StyleOptionsDefault = StyleOptions{ DoneString: "done!", ErrorString: "fail!", ETAPrecision: time.Second, ETAString: "~ETA", KeepTrackersTogether: false, PercentFormat: "%5.2f%%", PercentIndeterminate: " ??? ", Separator: " ... ", SnipIndicator: "~", SpeedPosition: PositionRight, SpeedPrecision: time.Microsecond, SpeedOverallFormatter: FormatNumber, SpeedSuffix: "/s", TimeDonePrecision: time.Millisecond, TimeInProgressPrecision: time.Microsecond, TimeOverallPrecision: time.Second, } ``` -------------------------------- ### Style Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/progress Retrieves the current styling configuration for the progress display. ```APIDOC ## func (*Progress) Style ### Description Style returns the current Style. ### Signature ```go func (p *Progress) Style() *Style ``` ``` -------------------------------- ### RenderHTML Method Source: https://pkg.go.dev/github.com/jedib0t/go-pretty/v6%40v6.8.1/list Renders the list in HTML format, using unordered lists (`