Anaminus / twrap.mod

This provides ways of wrapping text printed to the terminal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go.dev reference Go Report Card GitHub License

twrap.mod

This provides ways of wrapping and indenting text printed to the terminal.

You first construct a wrapper object TWConf and then you can use the various Wrap methods to print text indented and wrapped at the target line length.

Here is a simple example

twc, _ := twrap.NewTWConf()
twc.Wrap("the quality of mercy is not strained", 5)

More examples are available in the example test files.

There are also various Print functions which simply call fmt.Fprint functions and allow you to write:

twc.Print("Hello")

rather than:

fmt.Fprint(twc.W, "Hello")

About

This provides ways of wrapping text printed to the terminal

License:MIT License


Languages

Language:Go 100.0%