Skip to content

Releases: jedib0t/go-pretty

v2.1.0

15 May 01:38
e026101
Compare
Choose a tag to compare

This release removes the dependency on fatih/color. The text/color.go file now implements a coloring logic that makes more sense for use in cases like colored tables within colored tables.

This does change table.Style.Color in a backward-incompatible way. AutoIndexColumn and FirstColumn are now logically collapsed into a single IndexColumn variable inside table.Style.Color.

v2.0.0

14 May 02:04
2e8d249
Compare
Choose a tag to compare

This release changes Table in a backward-incompatible way (table.Style changes a lot) and hence the Major version bump.

  • table.Style is not a flat struct anymore; and provides a lot more configuration options
  • TableWriter exposes a few more interfaces to set Alignment/VAlignment for the Header/Footer
  • TableWriter now supports rendering "colored" tables/content within "colored" tables
  • Colored-text within cells align and wrap without any issues
  • Other minor bug-fixes and code cleanup

v1.0.0

08 May 03:42
a6c1bb9
Compare
Choose a tag to compare

This release contains a feature-packed Table and List packages.

Table

Pretty-print tables into ASCII/Unicode strings.

  • Add Rows one-by-one or as a group
  • Add Header(s) and Footer(s)
  • Auto Index Rows (1, 2, 3 ...) and Columns (A, B, C, ...)
  • Limit the length of the Rows; limit the length of individual Columns
  • Alignment - Horizontal & Vertical
    • Auto (horizontal) Align (numeric columns are aligned Right)
    • Custom (horizontal) Align per column
    • Custom (vertical) VAlign per column (and multi-line column support)
  • Mirror output to an io.Writer object (like os.StdOut)
  • Completely customizable styles
    • Many ready-to-use styles: table/style.go
    • Colorize Headers/Body/Footers using github.com/fatih/color
    • Custom text-case for Headers/Body/Footers
    • Enable separators between each row
    • Render table without a Border
  • Render as:
    • (ASCII/Unicode) Table
    • CSV
    • HTML Table (with custom CSS Style)
    • Markdown Table

List

Pretty-print lists with multiple levels/indents into ASCII/Unicode strings.

  • Append Items one-by-one or as a group
  • Indent/UnIndent as you like
  • Limit the length of the Lines/Items
  • Support Items with Multiple-lines
  • Mirror output to an io.Writer object (like os.StdOut)
  • Completely customizable styles
  • Render as:
    • (ASCII/Unicode) List
    • HTML List (with custom CSS Class)
    • Markdown List

v0.1.0

06 May 04:49
bed9130
Compare
Choose a tag to compare
v0.1.0 Pre-release
Pre-release

The first (pre)-release with a feature packed TableWriter - Pretty-print tables into ASCII/Unicode strings:

  • Add Rows one-by-one or as a group
  • Add Header(s) and Footer(s)
  • Auto Index Rows (1, 2, 3 ...) and Columns (A, B, C, ...)
  • Mirror output to an io.Writer object (like os.StdOut)
  • Limit the length of the Rows; limit the length of individual Columns
  • Alignment - Horizontal & Vertical
    • Auto (horizontal) Align (numeric columns are aligned Right)
    • Custom (horizontal) Align per column
    • Custom (vertical) VAlign per column (and multi-line column support)
  • Completely customizable styles
    • Many ready-to-use styles: table/style.go
    • Colorize Headers/Body/Footers using github.com/fatih/color
    • Custom text-case for Headers/Body/Footers
    • Enable separators between each row
    • Render table without a Border
  • Render as:
    • (ASCII/Unicode) Table
    • CSV
    • HTML Table (with custom CSS Style)
    • Markdown Table
+-----+------------+-----------+--------+-----------------------------+
|   # | FIRST NAME | LAST NAME | SALARY |                             |
+-----+------------+-----------+--------+-----------------------------+
|   1 | Arya       | Stark     |   3000 |                             |
|  20 | Jon        | Snow      |   2000 | You know nothing, Jon Snow! |
| 300 | Tyrion     | Lannister |   5000 |                             |
+-----+------------+-----------+--------+-----------------------------+
|     |            | TOTAL     |  10000 |                             |
+-----+------------+-----------+--------+-----------------------------+

A demonstration of all the capabilities can be found here: cmd/demo-table