Skip to main content

Module term

Module term 

Source
Expand description

Terminal rendering — colored, boxed, chart-y read-outs (host-side DX).

This is the “nice read-out on the terminal” layer. It consumes the plain data types from crate::report / crate::harness and renders them with color (via the console crate, which auto-detects a tty and honours NO_COLOR), unicode frames, grade badges, sparklines, and bar charts. The data modules stay free of presentation concerns; all of that lives here.

Every renderer takes an explicit color: bool so output is deterministic and testable (pass false for plain text). colors_on is the sensible default a CLI computes once.

Functions§

bar
A horizontal bar for frac ∈ [0,1] of the given character width.
boxed
Frame body lines in a rounded unicode box under title. Padding uses console::measure_text_width so embedded ANSI color codes don’t skew the alignment.
colors_on
Whether color should be used by default on this host (tty + not NO_COLOR).
grade_badge
A one-token grade badge, e.g. ECS-L / — below floor, colored by tier.
grade_short
A compact, fixed-width-friendly grade label (ECS-L / ) colored by tier — for table cells where — below floor would break the column.
render_corpus_summary
Render the corpus roll-up line block.
render_leaderboard
Render a ranked leaderboard table (grade-first ordering already applied by the caller via crate::report::leaderboard data, but this colors it).
render_report
Render one report as a colored, boxed read-out with a per-band R sparkline.
sparkline
A unicode sparkline of vals mapped onto their own min–max range.