tokmd-format
Output formatting and serialization for tokmd.
Overview
This is a Tier 2 crate that renders tokmd receipts to various formats: Markdown, TSV, JSON, JSONL, CSV, and CycloneDX SBOM.
Installation
[]
= "1.3"
Usage
use ;
// Print language report to stdout
print_lang_report?;
// Build ScanArgs with optional redaction
let args = scan_args;
// Normalize path for cross-platform consistency
let normalized = normalize_scan_input;
Supported Formats
Table Formats
- Markdown - Pipes with right-aligned numeric columns
- TSV - Tab-separated with header row
- JSON - Receipt with envelope metadata
Export Formats
- CSV - Standard comma-separated
- JSONL - Lines with type discriminator
- JSON - Full receipt array
- CycloneDX 1.6 - SBOM with tokmd-specific properties
Key Functions
Console Output
print_lang_report()- Language summaryprint_module_report()- Module breakdown
File Writing
write_export()- Write export datawrite_lang_json_to_file()- Language receiptwrite_module_json_to_file()- Module receiptwrite_export_jsonl_to_file()- Export receipt
ScanArgs Construction
scan_args()- Re-export fromtokmd-scan-argsfor compatibility
Redaction Modes
| Mode | Behavior |
|---|---|
None |
Paths shown as-is |
Paths |
Hash paths, preserve extensions |
All |
Hash paths and excluded patterns |
Re-exports
pub use ;
License
MIT OR Apache-2.0