termformatter

package
v0.0.0-...-a532a67 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Justify

func Justify(words []string, lineMax int) (result string)

func SeparateLines

func SeparateLines(words []string, lineMax int) (line []string, rest []string)

func SeparateWords

func SeparateWords(in string) []string

func ToLeft

func ToLeft(words []string, lineMax int) string

func ToRight

func ToRight(words []string, lineMax int) string

Types

type BlockDef

type BlockDef struct {
	// contains filtered or unexported fields
}

func NewBlockDef

func NewBlockDef(width int, lineFormatter FormatLineCB, lastLineFormatter FormatLineCB) BlockDef

type BlockFormatter

type BlockFormatter struct {
	// contains filtered or unexported fields
}

func NewBlockFormatter

func NewBlockFormatter(io app.Output, width int, blocks ...BlockDef) BlockFormatter

func (BlockFormatter) PrintBlocks

func (formatter BlockFormatter) PrintBlocks(contents ...string)

func (BlockFormatter) Println

func (formatter BlockFormatter) Println()

type FormatLineCB

type FormatLineCB func(words []string, lineMax int) string

Jump to

Keyboard shortcuts

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