Documentation
¶
Index ¶
- func ChopLineFunc(line string, maxWidth int, fnWidth WidthFunc) string
- func ChopMarkLine(line string, maxWidth int, chopMark string) string
- func ChopMarkLineFunc(line string, maxWidth int, chopMark string, fnWidth WidthFunc) string
- func Max(x, y int) int
- func Min(x, y int) int
- func PadLeft(s string, padWith rune, maxRunes int) string
- func PadLeftFunc(s string, padWith rune, maxWidth int, fnWidth WidthFunc) string
- func PadRight(s string, padWith rune, maxRunes int) string
- func PadRightFunc(s string, padWith rune, maxWidth int, fnWidth WidthFunc) string
- func VcsRevision() (rev string, ok bool)
- func WidthBytes(s string) int
- func WidthMonospace(s string) int
- func WidthRunes(s string) int
- func WillUseVar(v ...any)
- type BoxChars
- type BytesWidther
- type FnChopMarkLine
- type LineBuilder
- type LineWriter
- type MonospaceWidther
- type RunesWidther
- type WidthFunc
- type Widther
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChopMarkLineFunc ¶
func PadRightFunc ¶
func VcsRevision ¶
func WidthMonospace ¶
WidthMonospace returns the monospace width for the given string, that is, the number of same-size cells to be occupied by the string.
Equivalent to uniseg.StringWidth(s)
func WidthRunes ¶
WidthRunes returns the number of runes in s
Equivalent to utf8.RuneCountInString(s)
func WillUseVar ¶
func WillUseVar(v ...any)
Types ¶
type BoxChars ¶
type BoxChars struct { CornerTL string CornerTR string CornerBL string CornerBR string Left string Right string Top string Bottom string Cross string Hor string Ver string }
func BoxCharsAscii ¶
func BoxCharsAscii() BoxChars
func BoxCharsDos ¶
func BoxCharsDos() BoxChars
type BytesWidther ¶
type BytesWidther struct{}
func (BytesWidther) String ¶
func (bw BytesWidther) String() string
func (BytesWidther) Width ¶
func (bw BytesWidther) Width(s string) int
type FnChopMarkLine ¶
func ChopMarkLineSelector ¶
func ChopMarkLineSelector(w Widther) (fn FnChopMarkLine)
type LineBuilder ¶
type LineWriter ¶
type MonospaceWidther ¶
type MonospaceWidther struct{}
func (MonospaceWidther) String ¶
func (mw MonospaceWidther) String() string
func (MonospaceWidther) Width ¶
func (mw MonospaceWidther) Width(s string) int
type RunesWidther ¶
type RunesWidther struct{}
func (RunesWidther) String ¶
func (rw RunesWidther) String() string
func (RunesWidther) Width ¶
func (rw RunesWidther) Width(s string) int
Click to show internal directories.
Click to hide internal directories.