Skip to main content

Crate tokmd_format

Crate tokmd_format 

Source
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§

DiffRenderOptions

Enums§

DiffColorMode

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 ScanArgs with 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.