Expand description
§tokmd-format
Tier 2 (Formatting)
This crate handles the rendering and serialization of tokmd receipts.
It supports Markdown, TSV, JSON, JSONL, CSV, and CycloneDX formats.
§What belongs here
- Serialization logic (JSON/CSV/CycloneDX)
- Markdown and TSV table rendering
- Output file writing
- Redaction integration (via tokmd-redact re-exports)
- ScanArgs integration (via tokmd-scan-args re-export)
§What does NOT belong here
- Business logic (calculating stats)
- CLI argument parsing
- Analysis-specific formatting (use tokmd-analysis-format)
Structs§
Enums§
Functions§
- compute_
diff_ rows - Compute diff rows from two lang reports. Compute diff rows between two language reports.
- compute_
diff_ totals - Compute totals from diff rows.
- create_
diff_ receipt - Create a DiffReceipt for JSON output.
- normalize_
scan_ input - Normalize a path to forward slashes and strip leading
./segments. - print_
lang_ report - Print a language report to stdout.
- print_
module_ report - Print a module report to stdout.
- redact_
path - Redact a path by hashing it while preserving the file extension.
- render_
diff_ md - Render diff as Markdown table.
- render_
diff_ md_ with_ options - Render diff as Markdown table with optional compact/color behavior.
- scan_
args - Construct
ScanArgswith optional path and exclusion redaction. - short_
hash - Compute a short (16-character) BLAKE3 hash of a string.
- write_
export - write_
export_ jsonl_ to_ file - Write export data as JSONL to a file path.
- write_
lang_ json_ to_ file - Write a lang report as JSON to a file path.
- write_
lang_ report_ to - Write a language report to a writer.
- write_
module_ json_ to_ file - Write a module report as JSON to a file path.
- write_
module_ report_ to - Write a module report to a writer.