Expand description
Content-addressed cache of pandoc JSON ASTs.
Obtain-AST dominates cost. After the first successful parse of a given (format, source) pair, reuse JSON from:
- Process-local memory (hash → Arc
) - Disk under
$SNAPPER_PANDOC_CACHE_DIRor$XDG_CACHE_HOME/snapper/pandoc-ast(disable withSNAPPER_PANDOC_CACHE=0)
Keys are SHA-256 over format \\0 input. Values are raw pandoc JSON bytes.
This is the practical speed lever for CLI re-runs and multi-file batches
without changing the AST→region model.
Functions§
- cache_
key - Stable key for (format, input).
- clear_
memory - Clear process-local memory cache (tests / benchmarks).
- get_
json - Look up cached pandoc JSON for (format, input).
- put_
json - Store pandoc JSON for (format, input) in memory and on disk.