Skip to content

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

License

pirmd/text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages