Skip to main content

Module diff_format

Module diff_format 

Source
Expand description

Renderers for crate::diff::BibDiff: hand-rolled ANSI text and structured JSON (#135 sub-feature C).

Hand-rolled ANSI deliberately — adding a color crate for three escape codes (green / red / yellow) would just be dependency churn. Color is gated by the caller (TTY detection lives at the CLI layer so we keep this module pure).

Functions§

render_json
Render a BibDiff as structured JSON. Just serde_json::to_string_pretty — kept here so the CLI / MCP have one canonical entry point.
render_text
Render a BibDiff as a human-readable text report. header_a / header_b are free-form labels (e.g. file paths or “question abc123”) that go in the “=== bib diff: vs ===” line.