textstyles

package
v1.28.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: BSD-2-Clause-Views Imports: 8 Imported by: 0

Documentation

Overview

This package handles styled strings. It can strip styling from strings and it can turn a styled string into a series of screen cells. Some global variables can be used to configure how various things are rendered.

Index

Constants

View Source
const BACKSPACE = '\b'

Variables

View Source
var ManPageBold = twin.StyleDefault.WithAttr(twin.AttrBold)
View Source
var ManPageHeading = twin.StyleDefault.WithAttr(twin.AttrBold)
View Source
var ManPageUnderline = twin.StyleDefault.WithAttr(twin.AttrUnderline)

Functions

func WithoutFormatting

func WithoutFormatting(s string, lineNumber *linenumbers.LineNumber) string

Types

type StyledRunesWithTrailer added in v1.27.2

type StyledRunesWithTrailer struct {
	StyledRunes []twin.StyledRune
	Trailer     twin.Style
}

func StyledRunesFromString added in v1.27.2

func StyledRunesFromString(prefix string, s string, lineNumber *linenumbers.LineNumber) StyledRunesWithTrailer

Turn a (formatted) string into a series of screen cells

The prefix will be prepended to the string before parsing. The lineNumber is used for error reporting.

type UnprintableStyleT

type UnprintableStyleT int

How do we render unprintable characters?

const (
	UnprintableStyleHighlight UnprintableStyleT = iota
	UnprintableStyleWhitespace
)
var UnprintableStyle UnprintableStyleT

Jump to

Keyboard shortcuts

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