Show HN: ZigZag – Generate Markdown code reports from directories (Zig) (github.com)

2 points by anzedev ↗ HN
Hi HN,

I built ZigZag, a command-line tool written in Zig that recursively scans source code directories and generates a single markdown report containing the code and metadata.

It’s designed to be fast on large codebases and uses: - Parallel directory and file processing - A persistent on-disk cache to avoid re-reading unchanged files - Different file reading strategies based on file size (read vs mmap) - Timezone-aware timestamps in reports

Each directory produces a report.md with a table of contents, syntax-highlighted code blocks, file sizes, modification times, and detected language.

Repo: https://github.com/LegationPro/zigzag

I built this mainly for auditing and documenting large repositories. Feedback, critiques, and ideas are welcome.

1 comment

[ 2.7 ms ] story [ 22.2 ms ] thread
Looks cool! I'm curious why you chose to use read for small files and mmap for large files. I haven't really used mmap much yet, but my understanding is that it's just better at random access patterns, and read / write is better at sequential access patterns. Did you observe higher speeds with mmap above a size threshold? Did you try playing around with the Reader buffer to see if you could get better throughput with that? Also have you played around with std.Io in 0.16.0 yet? They recently merged in an API for mmap.