Documentation
¶
Overview ¶
Package report renders the human-audience analysis reports: a colorized, TTY-aware terminal summary and a committable GitHub-flavored Markdown report. It is infrastructure: it reads the frozen application.Result / emit.View and the domain model but never mutates them (ADR 0004), and every emitter sorts its output so artifacts are byte-stable (golden tests depend on it).
Index ¶
Constants ¶
const ReportMarkdownName = "report.md"
ReportMarkdownName is the conventional committable report filename.
Variables ¶
This section is empty.
Functions ¶
func Markdown ¶
Markdown renders a committable GitHub-flavored Markdown report from the View: a corpus-overview table, a broken-link/anchor table (file, line, target, suggested fix), orphan and unreachable lists with remediation, a hub/authority table, and a knowledge-gap section. Every cell is escaped (emit.EscapeTableCell) so a hostile document title/path cannot break a GFM table or inject markdown (ADR 0003). Output is deterministic (the View is sorted).
func Terminal ¶
Terminal writes a human-facing analysis summary to w. It front-loads the actionable problems (U-shaped attention): counts, then broken links + broken anchors with file:line, then orphans vs. unreachable (clearly separated, each with its distinct remediation hint, ADR 0007), then top hubs/authorities, then a knowledge-gap note. Color is emitted only when w is a TTY and NO_COLOR is unset (or forced via opts). Output is deterministic (the View is sorted).
Types ¶
type ColorMode ¶
type ColorMode int
ColorMode selects how the terminal report decides whether to emit ANSI color.
const ( // ColorAuto enables color only when the writer is a terminal and NO_COLOR is // unset (the default). ColorAuto ColorMode = iota // ColorNever disables color unconditionally (--no-color or a non-TTY sink). ColorNever // ColorAlways forces color on (rarely needed; mainly for tests/pipes). ColorAlways )
type TerminalOptions ¶
type TerminalOptions struct {
// Color selects color behavior (auto/never/always). Auto is TTY+NO_COLOR aware.
Color ColorMode
// Quiet renders only the one-line summary (the legacy `matlatl .` output).
Quiet bool
}
TerminalOptions tunes the terminal report.