OpenNTI / sphinxcontrib-programoutput

Sphinx extension for capturing program output
BSD 3-Clause "New" or "Revised" License
37 stars 17 forks source link

Caching to disk - PR suggestion #57

Open oz123 opened 2 years ago

oz123 commented 2 years ago

First, thank you for creating this extension and publishing it. I found it very useful! The current cache mechanism is only in memory, and it's no so straight how to add on disk caching. Further, if you try adding a cache mechanism trough conf.py you will bump into pickle errors. Hence, I forked this extension and created a JSONCache class which saved the commands and output to disk. It's useful in cases you do 'make clean' but don't want your commands to run again for a couple of possible reasons:

My code works, but it still lacks tests. However, if you are interested in it, I will open a PR and we can discuss what is the best approach to create effective tests.