printers

package
v0.0.0-...-d277e4d Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package printers contains helpers for formatted terminal output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DaysIn

func DaysIn(then time.Time) int

DaysIn returns the number of days in the month for the provided time.

func NextMonth

func NextMonth(then time.Time) time.Time

NextMonth returns the first day of the month following the provided time.

func StartDay

func StartDay(then time.Time) time.Weekday

StartDay returns the weekday of the first day of the month.

Types

type PrettyPrint

type PrettyPrint struct {
	ShowID bool
}

PrettyPrint renders collections with styled terminal output.

func (*PrettyPrint) Calendar

func (pp *PrettyPrint) Calendar(on time.Time, entries ...*entry.Entry)

Calendar renders a full-month view anchored at the provided time.

func (*PrettyPrint) Collection

func (pp *PrettyPrint) Collection(entries ...*entry.Entry)

Collection renders a list of entries in a human friendly format.

func (*PrettyPrint) NewLine

func (pp *PrettyPrint) NewLine()

NewLine prints an empty line.

func (*PrettyPrint) PrintMonth

func (pp *PrettyPrint) PrintMonth(then time.Time, entries ...*entry.Entry)

PrintMonth renders a calendar month annotated with entry counts.

func (*PrettyPrint) PrintMonthCount

func (pp *PrettyPrint) PrintMonthCount(then time.Time, count []int)

PrintMonthCount renders a calendar month given per-day counts.

func (*PrettyPrint) PrintMonthDemo

func (pp *PrettyPrint) PrintMonthDemo(then time.Time)

PrintMonthDemo renders a randomized month useful for demos.

func (*PrettyPrint) PrintMonthLong

func (pp *PrettyPrint) PrintMonthLong(then time.Time, entries ...*entry.Entry)

PrintMonthLong renders a long-form calendar listing entries per day.

func (*PrettyPrint) Title

func (pp *PrettyPrint) Title(title string)

Title prints a stylized section title.

func (*PrettyPrint) TitleWithCount

func (pp *PrettyPrint) TitleWithCount(title string, count int)

TitleWithCount prints a section title with an entry count suffix.

func (*PrettyPrint) Tracking

func (pp *PrettyPrint) Tracking(entries ...*entry.Entry)

Tracking prints a single-month tracker for the supplied entries.

func (*PrettyPrint) TrackingYear

func (pp *PrettyPrint) TrackingYear(entries ...*entry.Entry)

TrackingYear prints a 12-month tracker starting in January.

Jump to

Keyboard shortcuts

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