text

package
v0.0.0-...-7643193 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package text is an abstraction layer for different text formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WordWrap

func WordWrap(text string, width, maxLines int) []string

WordWrap wraps long lines.

Types

type Base

type Base struct {
	io.Writer
}

Base is a base for implementations of Writer.

func (*Base) Unwrap

func (b *Base) Unwrap() io.Writer

type Writer

type Writer interface {
	io.Writer

	Clone(io.Writer) Writer
	Unwrap() io.Writer

	OK()
	Error()
	Redirect(string)
	Redirectf(string, ...any)
	Status(int, string)
	Statusf(int, string, ...any)
	Title(string)
	Titlef(string, ...any)
	Subtitle(string)
	Subtitlef(string, ...any)
	Text(string)
	Textf(string, ...any)
	Empty()
	Link(string, string)
	Linkf(string, string, ...any)
	Item(string)
	Itemf(string, ...any)
	Quote(string)
	Raw(string, string)
	Separator()
}

Writer builds a textual response.

Directories

Path Synopsis
Package gmap builds gophermaps.
Package gmap builds gophermaps.
Package gmi build Gemini responses.
Package gmi build Gemini responses.
Package guppy builds Guppy responses.
Package guppy builds Guppy responses.
Package plain converts HTML to plain text and vice versa.
Package plain converts HTML to plain text and vice versa.

Jump to

Keyboard shortcuts

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