~dricottone/textwrap

ref: db7d9652c9160ef4c2a12a0a71da325cbb994c72 textwrap/README.md -rw-r--r-- 891 bytes
db7d9652Dominic Ricottone Initial commit 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# 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)

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


## Usage (library)

```go
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