screens

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 12 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 screens draws each of doit's screens from the service's answer.

The helpers here print as rich does: a line cut at the terminal with an ellipsis, a sentence wrapped at its words, and a rule under a title. Each measures in terminal cells, as rich does, where gotermstyle.Clip counts runes. Text from the service is stripped of terminal controls before it is measured, as printedtable strips its cells, so stored text cannot drive the terminal. Layout is computed on the plain text, and color goes on after, so a cut can never land inside an escape sequence.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Explain

func Explain(w io.Writer, answer service.Next, widths Widths, p gotermstyle.Palette) error

Explain prints the draw with every number behind it: each pursuit owed first, then the reasons the register gives, then how to read the table.

func Next

func Next(w io.Writer, answer service.Next, now time.Time, widths Widths, p gotermstyle.Palette) error

Next prints what to do now: today's events, then every pursuit, the offered ones first in the draw's order, and the rest dimmed under them.

func Today

func Today(w io.Writer, answer service.Today, widths Widths, p gotermstyle.Palette) error

Today prints the day: the figures, what it still owes, then what it has had.

Color finds the structure and marks a state, and never fills a whole row. The list headings are cyan and each group's name is blue. A done entry's hour is green, a due row's note yellow or red by how late it is, and a group that could not be read red.

Types

type Widths

type Widths struct {
	// Console is where a printed line is cut or wrapped.
	Console int
	// Layout is what a multi-column view may spend: the terminal, capped so
	// a trailing column stays near the rest on an ultrawide one.
	Layout int
}

Widths holds the console's width and the layout's width.

func TerminalWidths

func TerminalWidths() Widths

TerminalWidths are this process's widths, both read from gotermstyle.Columns.

Jump to

Keyboard shortcuts

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