textstyles

package
v1.23.12 Latest Latest
Warning

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

Go to latest
Published: May 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 CellsWithTrailer

type CellsWithTrailer struct {
	Cells   []twin.Cell
	Trailer twin.Style
}

func CellsFromString

func CellsFromString(prefix string, s string, lineNumber *linenumbers.LineNumber) CellsWithTrailer

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