print

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BLOCK dao.Block
View Source
var COLORIZE bool

Functions

func CreateTable added in v0.20.0

func CreateTable[T Items](
	options PrintTableOptions,
	defaultHeaders []string,
	taskHeaders []string,
	data []T,
	writer io.Writer,
) table.Writer

func FormatTable added in v0.20.0

func FormatTable(theme dao.Theme) table.Style

func GetMaxTextWidth added in v0.30.0

func GetMaxTextWidth(text string) int

func GetTextDimensions added in v0.30.0

func GetTextDimensions(text string) (int, int)

func PrintProjectBlocks

func PrintProjectBlocks(projects []dao.Project, colorize bool, block dao.Block, f Formatter) string

func PrintTable added in v0.20.0

func PrintTable[T Items](
	data []T,
	options PrintTableOptions,
	defaultHeaders []string,
	taskHeaders []string,
	writer io.Writer,
)

func PrintTaskBlock added in v0.6.1

func PrintTaskBlock(tasks []dao.Task, colorize bool, block dao.Block, f Formatter) string

func PrintTree added in v0.6.1

func PrintTree(config *dao.Config, theme dao.Theme, listFlags *core.ListFlags, tree []dao.TreeNode)

func RenderTable added in v0.20.0

func RenderTable(t table.Writer, output string)

Types

type Formatter added in v0.30.0

type Formatter interface {
	Format(prefix string, key string, value string, separator string, keyColor *dao.ColorOptions, valueColor *dao.ColorOptions) string
}
var FORMATTER Formatter

type GookitFormatter added in v0.30.0

type GookitFormatter struct{}

func (GookitFormatter) Format added in v0.30.0

func (g GookitFormatter) Format(
	prefix string,
	key string,
	value string,
	separator string,
	keyColor *dao.ColorOptions,
	valueColor *dao.ColorOptions,
) string

type Items added in v0.20.0

type Items interface {
	GetValue(string, int) string
}

type PrintTableOptions added in v0.20.0

type PrintTableOptions struct {
	Output           string
	Theme            dao.Theme
	Tree             bool
	Color            bool
	AutoWrap         bool
	OmitEmptyRows    bool
	OmitEmptyColumns bool
}

type TviewFormatter added in v0.30.0

type TviewFormatter struct{}

func (TviewFormatter) Format added in v0.30.0

func (t TviewFormatter) Format(
	prefix string,
	key string,
	value string,
	separator string,
	keyColor *dao.ColorOptions,
	valueColor *dao.ColorOptions,
) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳