Documentation
¶
Overview ¶
Package render selects which output format cmd/plat uses for a lookup and detects whether stdout is an interactive terminal. It does not import internal/render/plain, internal/render/human, or internal/render/machine itself — the caller (cmd/plat) dispatches to the right one based on the Format this package returns, keeping this leaf package free of all three renderers' dependencies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTerminal ¶
IsTerminal reports whether f is connected to an interactive terminal.
Types ¶
type Format ¶
type Format int
Format selects which renderer cmd/plat dispatches to: FormatHuman to internal/render/human's styled output, FormatPlain to internal/render/plain's unstyled output, FormatJSON/FormatNDJSON to internal/render/machine's encoder.
func ParseFormat ¶
ParseFormat validates the -o/--output flag's value.
func Select ¶
Select resolves the format to use: an explicit -o value always wins (including "human" even under NO_COLOR or a non-terminal destination — lipgloss.Fprint's own downsampling strips ANSI in that case, this function never second-guesses an explicit choice). With no explicit value, a TTY with no NO_COLOR gets Human; anything else (a pipe, or NO_COLOR set) gets Plain.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package human renders a merged domain record as a styled, colorized view for interactive terminals — the FormatHuman counterpart to internal/render/plain's unstyled FormatPlain.
|
Package human renders a merged domain record as a styled, colorized view for interactive terminals — the FormatHuman counterpart to internal/render/plain's unstyled FormatPlain. |
|
Package machine encodes a model.Record as the stable JSON/NDJSON wire format described in docs/schema.md.
|
Package machine encodes a model.Record as the stable JSON/NDJSON wire format described in docs/schema.md. |