I am writing two books. One is on Rust programming and another is on geometry, so I have syntax highlighted code and in second has lost of diagrams.

Perhaps Aditya Mahajan can tell me how can I cache code snippets. Invoking VIM will have heavy penalty on highlighting the code otherwise.

Other than that, how can I cache Metafun images so that they are not recomputed on every processing of file.

--
Respect,
Shiv Shankar Dayal