Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.64 KB

README.md

File metadata and controls

50 lines (36 loc) · 1.64 KB

PACKAGE STYLE

GoDoc  Go Report Card 

text provides text manipulation functions (like indentation, wrapping, columnize,...) that can differentiate printable from non-printable sequences (like ANSI colored sequences).

text provides helpers to format tables and to print diff between text.

EXAMPLE

package main

import (
    "fmt"

    "github.com/pirmd/text"
    "github.com/pirmd/text/ansi"
)

func Example() {
    tab := text.NewTable().SetMaxWidth(80).SetGrid(" ", "-", " ")

     tab.Rows(
         []string{"Column1", "Column2", "Column3"},
         []string{"Basic column", "This one is here\nto demonstrate\nthat colums with several lines work too", "Any " + ansi.SetBold("formatted") + " string can be inserted too without beaking the table."},
         []string{"", "This second row is here to test multi-lines rows format", "Also possibly a second chance to verify that multi-lines is working"},
     )

     fmt.Println(tab.Draw())
}

INSTALLATION

Everything should work fine using go standard commands (build, get, install...).

USAGE

Running go doc github.com/pirmd/text should give you helpful guidelines on available features.

CONTRIBUTION

If you feel like to contribute, just follow github guidelines on forking then send a pull request