Documentation
¶
Overview ¶
Package printers contains helpers for formatted terminal output.
Index ¶
- func DaysIn(then time.Time) int
- func NextMonth(then time.Time) time.Time
- func StartDay(then time.Time) time.Weekday
- type PrettyPrint
- func (pp *PrettyPrint) Calendar(on time.Time, entries ...*entry.Entry)
- func (pp *PrettyPrint) Collection(entries ...*entry.Entry)
- func (pp *PrettyPrint) NewLine()
- func (pp *PrettyPrint) PrintMonth(then time.Time, entries ...*entry.Entry)
- func (pp *PrettyPrint) PrintMonthCount(then time.Time, count []int)
- func (pp *PrettyPrint) PrintMonthDemo(then time.Time)
- func (pp *PrettyPrint) PrintMonthLong(then time.Time, entries ...*entry.Entry)
- func (pp *PrettyPrint) Title(title string)
- func (pp *PrettyPrint) TitleWithCount(title string, count int)
- func (pp *PrettyPrint) Tracking(entries ...*entry.Entry)
- func (pp *PrettyPrint) TrackingYear(entries ...*entry.Entry)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) 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.