artisticat1 / obsidian-tikzjax

Render LaTeX and TikZ diagrams in your notes
MIT License
395 stars 23 forks source link

Cache: Automatic cleanup of files #58

Open mayurankv opened 7 months ago

mayurankv commented 7 months ago

It would be great if there was automatic cleaning of files based on when there is such a codeblock in the file or not. This would be done by caching the files and if there is no such block that caused the file to be rendered on startup of the plugin, the file should be deleted. This should be in addition to the manual setting in settings.

I implemented something similar for my plugin Code Styler which caches external code files. It is basically a cache manager json with each cached file and the sources that reference it. On creation of a block, it adds an entry to the cache, and on startup, it checks the files where those caches point to and checks if the relevant block is still there, if not, it deletes the cache. This would be much cleaner than manual removal. Once again, I'm happy to work on this if you're happy with that!