text

package
v0.0.0-...-af80692 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyMargin

func ApplyMargin(input string, availableWidth, textWidth int) string

func Color

func Color(input string, color Colo) string

Color returns the input with the given ANSI color applied color can be a hex string e.g. #FF0000

func RuneCount

func RuneCount(s string) int

func Wrap

func Wrap(text string, maxlen int) string

Wrap wraps text so that each line is no longer than maxlen by inserting newlines. Spaces and '-' will be used as natural breaking points, but if individual words are longer than maxlen a newline will be inserted to break them up.

Types

type Colo

type Colo string
const (
	Ch1   Colo = "#FF0000" // red
	Ch2   Colo = "#FFFF00" // yellow
	Ch3   Colo = "#FF00FF" // fuchsia
	Clink Colo = "#6495ED" // cornflowerblue
	Ccode Colo = "#EEE8AA" // palegoldenrod
)
type Link struct {
	URL, Name string
	// contains filtered or unexported fields
}
type Links struct {
	// contains filtered or unexported fields
}

func (*Links) Add

func (l *Links) Add(ypos, index int, url, name string)

func (*Links) Count

func (l *Links) Count() int

func (Links) LinkAt

func (l Links) LinkAt(y int) *Link

func (Links) Number

func (l Links) Number(n int) *Link

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL