formatx

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptiveCodeBlock

func AdaptiveCodeBlock(msg string) string

AdaptiveCodeBlock trims whitespace and wraps a message in a code block. If message is a single line, an inline code block is used.

func BulletPointListFromMessages

func BulletPointListFromMessages(msgs []string) string

BulletPointListFromMessages creates a bullet-point list from messages.

func CodeBlock

func CodeBlock(msg string) string

CodeBlock trims whitespace and wraps a message in a code block.

func RemoveHyperlinks(in string) string

RemoveHyperlinks removes the hyperlink text from url

func StructDumper

func StructDumper() litter.Options

StructDumper default dumper for structs

func ToTitle

func ToTitle(in fmt.Stringer) string

ToTitle returns English specific title casing.

Types

type Table

type Table struct {
	Headers []string
	Rows    [][]string
}

Table holds table data.

type TableOutput

type TableOutput struct {
	Table Table
	Lines []string
}

TableOutput returns table output.

type TableSpace

type TableSpace struct{}

TableSpace destructs table sparated by spaces.

func (*TableSpace) TableSeparated

func (*TableSpace) TableSeparated(in string) TableOutput

TableSeparated takes a string input and returns a slice of slices containing the separated values in each row and a slice of the original input lines. TODO: change the output to a JSON or YAML format to allow standardized parser interface.

Jump to

Keyboard shortcuts

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