text

package module
v0.0.0-...-6ab4a36 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 2 Imported by: 1

README

text

Text handling utilities.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Span

type Span struct {
	Bold    bool
	Oblique bool
	Content string
	Link    *Text
}

Span implements a text span with formatting options.

type Text

type Text struct {
	Spans []Span
}

Text represents a text as a collection of formatted spans with optional formatting information.

func New

func New() *Text

New creates a new text instance.

func (*Text) Append

func (text *Text) Append(t *Text) *Text

Append appends the argument text to the text object.

func (*Text) Bold

func (text *Text) Bold(content string) *Text

Bold appends a bold text span to the text object.

func (*Text) BoldOblique

func (text *Text) BoldOblique(content string) *Text

BoldOblique appends a bold oblique text span to the text object.

func (*Text) BoldObliquef

func (text *Text) BoldObliquef(format string, a ...interface{}) *Text

BoldObliquef appends a bold oblique text span to the text object.

func (*Text) Boldf

func (text *Text) Boldf(format string, a ...interface{}) *Text

Boldf appends a bold formatted text span to the text object.

func (*Text) HTML

func (text *Text) HTML() string

HTML creates HTML representation of the text.

func (text *Text) Link(url string, link *Text) *Text

Link appends a hyperlink to the text object.

func (*Text) Oblique

func (text *Text) Oblique(content string) *Text

Oblique appends an oblique text span to the text object.

func (*Text) Obliquef

func (text *Text) Obliquef(format string, a ...interface{}) *Text

Obliquef appends an oblique formatted text span to the text object.

func (*Text) Plain

func (text *Text) Plain(content string) *Text

Plain appends a plain text span to the text object.

func (*Text) Plainf

func (text *Text) Plainf(format string, a ...interface{}) *Text

Plainf appends a plain formatted text span to the text object.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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