term

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package term renders the compiler's Rich-style markup ([red bold]…[/red bold]) as ANSI colour, or strips it when the output is not a terminal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

type Writer struct {
	TTY bool // output is a terminal (in-place progress lines are safe)
	// contains filtered or unexported fields
}

Writer prints markup to an underlying stream.

func New

func New(f *os.File) *Writer

New returns a Writer for f, colouring only when f is a terminal and $NO_COLOR is unset.

func (*Writer) Printf

func (t *Writer) Printf(format string, args ...any)

Printf formats, renders markup and writes.

func (*Writer) Println

func (t *Writer) Println(s string)

Println renders markup in s and writes it with a newline.

func (*Writer) Render

func (t *Writer) Render(s string) string

Render converts markup in s to ANSI escapes (or plain text).

Jump to

Keyboard shortcuts

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