style

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintCodeBlock

func PrintCodeBlock(content string) string

PrintCodeBlock prints the given content inside a styled code block

TODO: at the moment of writing, television couldn't correctly render box-drawing characters, so use +, | and - for now. Once there is a fix, change the lines to those below:

topBorder := "┌" + strings.Repeat("─", lineWidth-2) + "┐"
bottomBorder := "└" + strings.Repeat("─", lineWidth-2) + "┘"
leftBorder := "│ "
rightBorder := " │"

func StyleLongDescription

func StyleLongDescription(styler TextStyler, text string) string

func Wrap

func Wrap(text, indent string) string

Types

type TextStyler

type TextStyler uint8
const (
	StyledText TextStyler = 1 << iota
)

func (TextStyler) Bold

func (s TextStyler) Bold(text string) string

func (TextStyler) Dim

func (s TextStyler) Dim(text string) string

func (TextStyler) Strikethrough

func (s TextStyler) Strikethrough(text string) string

func (TextStyler) Underline

func (s TextStyler) Underline(text string) string

Jump to

Keyboard shortcuts

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