text

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: MIT Imports: 8 Imported by: 4

Documentation

Overview

Package text contains functions for formatting console text.

Index

Constants

View Source
const StandardTerminalWidthInChars = 80

StandardTerminalWidthInChars describes the width of a standard terminal window.

Variables

This section is empty.

Functions

func Boldf

func Boldf(format string, args ...interface{}) string

Boldf returns the formatted string, with bash-style "bright white" text.

If the program has determined stdout is not a color terminal, the text will be formatted and returned, un-styled.

func CenterText

func CenterText(text string, width int) string

CenterText returns the given text centered according to the specified width in characters.

func PadCurrencyLeft

func PadCurrencyLeft(d decimal.Decimal, width int) string

PadCurrencyLeft formats the decimal value and pads the left side to the specified width.

func PadIntegerLeft

func PadIntegerLeft(i int, width int) string

PadIntegerLeft formats the integer and pads the left side to the specified width.

func PadTextLeft

func PadTextLeft(text string, width int) string

PadTextLeft pads the left side of the given text to ensure it is the specified width.

func PadTextRight

func PadTextRight(text string, width int) string

PadTextRight pads the right side of the given text to ensure it is the specified width.

func WrapText

func WrapText(text string, width int) string

WrapText returns the given text wrapped at the specified width in characters.

Types

This section is empty.

Directories

Path Synopsis
Package banner is a dynamic ASCII art banner generator.
Package banner is a dynamic ASCII art banner generator.

Jump to

Keyboard shortcuts

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