~dricottone/textwrap

An (overly) simple line wrapping tool
Updating go version and module name

clone

read-only
https://git.dominic-ricottone.com/~dricottone/textwrap
read/write
git@git.dominic-ricottone.com:~dricottone/textwrap

You can also use your local clone with git send-email.

#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