render

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package render turns the core data types into bytes. Every function is a pure transformation from a session value to a Writer: it performs no history lookup and makes no decisions about which session to show. There are three encodings (Markdown, HTML, JSON) and three views (a full Thread, a Source's metadata, a listing). The Format is a closed set, so dispatch is a switch rather than an interface — polymorphism lives at the Provider boundary, not here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Age added in v0.6.0

func Age(t time.Time) string

Age renders a recent timestamp as a relative age and an old one as a plain date. The cutoff is a week — past that, "9d ago" is arithmetic, not an answer.

func List

func List(w io.Writer, provider string, summaries []session.Summary, f session.Format) error

List renders a ranked listing: a plain table by default, or a JSON array for scripts. HTML has no listing view; the cli rejects that combination before it gets here. provider names the agent every row belongs to, and is empty for a cross-agent listing, where each row carries its own.

func Meta

func Meta(w io.Writer, s session.Source, f session.Format) error

Meta renders only a session's metadata/frontmatter (the -i view).

func Thread

func Thread(w io.Writer, t session.Thread, f session.Format) error

Thread renders a full conversation timeline in the requested format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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