~dricottone/textwrap

ref: b4b5e0f115cd621eb226f0de660f7b641b61f724 textwrap/README.md -rw-r--r-- 891 bytes
b4b5e0f1Dominic Ricottone Updating go version and module name 2 years ago

#textwrap

I have a variety of projects that:

  • need a textwrapping library, even if it is overly simple
  • could benefit from a thorough textwrapping library
  • I want to work on instead of a thorough textwrapping library

This package serves as:

  • a handy utility
  • a simple library that works for now
  • a distribution mechanism for making incremental updates from a simple library to a thorough one that all of my projects can benefit from

#Development Status

Very alpha

#Usage (utility)

$ echo '12345' | textwrap -length 2
12
34
5

#Usage (library)

import (
	"fmt"
	"regexp"
	textwrap "git.dominic-ricottone.com/textwrap/common"
)

func main() {
	a := []string{
		"> hello!",
		"> this is quoted",
		"hi there!",
		"this is not",
	}
	for _, line := range textwrap.WrapArray(a,10) {
		fmt.Println(line)
	}
}

#Licensing

GPLv3