Reference a git repo

I mean I could trivially create a cache as some sort of json file yeah. Not sure if Obsidian suggests adding your own cache to their metadata cache but whatever for now. This would look like a list of files each of which has a list of downloaded files. I suppose you could iterate through the list of files, check cache sections for the relevant codeblocks and update the cache depending on the code that is still written. Then when you add a new file, it adds to the cache but when you remove one it does nothing. To remove the old file you would have to wait for some frequency based cleanup or a manual cleanup.

Sorry just thinking aloud there. Yeah you are right, that is a much better idea, but I haven’t done any cache implementations in Obsidian before so I probably need to go look at how other plugins do it instead of creating a botch job aha.

1 Like

Thank you so much as well! I didn’t really have a solid or clear understanding of how this would take shape and you had the Ideas that actually helped so Thank you!!!

1 Like

I’ve not heard of any “user” initiated cache, but I’ve not ventured to far into those areas of Obsidian. But come to think of it, Dataview must have some caching of inline fields and tasks I reckon so it might have some example code.

It would be nice to know if you find something on this subject. Maybe a post in Share & showcase would be nice in due time? (Or a private message… :‐) )

No problem, it’s an interesting code case, so I’m happy to contribute with some thoughts on the subject.

2 Likes

Sure, I’d be happy to update you! I definitely know a fair few plugins do their own indexing (definitely dataview but also others that I can’t recall off the top of my head). I’ll do a bit of digging and see where I get once I’ve finished the rest of the bits to get done.

2 Likes

The indexing which is pretty basic is now done, you can have a look at the repo for the implementation or I’m happy to give a brief overview! Also everything is now pretty much done, I’m just finishing off the last things like making stuff decided by settings etc. and encoding a font and I’m done. It should be released in the next few days.

1 Like

This is now released!

EDIT: To anyone who finds this thread, the plugin is found on GitHub at Code Styler.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.