Closed cuddlecake closed 2 years ago
Hi @cuddlecake,
thank you for this detailed explanation. This sound like a great idea. If you want, you can implement it and create a pull request in this repo as this will be released with other features in an upcoming update.
I would suggest adding a new function to utils.tsx
which uses the existing parseVaults()
function if the obsidian.json
file doesnt exist.
If you need something else, please let me know.
There might be some issues with the package.json
configs. In there you have to specify whether a preference is optional or required. Right now, a vault path or multiple vault paths is a required preference as the extension doesnt work without it. With the obsidian.json
file this setting has to be optional when it exists and required when it doesnt. I dont know yet how this behaviour could be achieved.
I took a stab at implementing something, but yeah, not being able to customize the onboarding experience is definitely a hindrance. My current attempt would use the vaultpaths from preferences if it is already configured, otherwise use vault paths from obsidian.json like this.
You can see the code on the main branch of my fork: https://github.com/cuddlecake/obsidian-raycast where I updated just the Create Note
Command.
Not feeling comfortable with it, because I do see the value of having an obsidian vault being the focus of the plugin, as I primarily work with one specific vault as well.
Thanks for trying to implement it.
Can we somehow verify that obsidian.json
exists for every Mac-user? I can ask in the Obsidian discord server, I guess someone there will know.
If this has been verfied then we are good to go. We should however keep the preference (marked as not required) so that one can "select" vaults as one may not want all vaults to be used by Raycast.
Created a PR and updated all the commands to use the obsidian.json vaults if preference.
I would expect every Obsidian installation to have an obsidian.json as soon as at least one vault has been created or opened with that Obsidian installation. Tested this with a clean install of Obsidian, where the obsidian.json was created when I opened a vault.
So, what to do in the case of a user not even having opened any vaults?
One solution could be to show a Detail
with content like this:
Obsidian creates a json file that has the location of every vault that has been opened with Obsidian, with the following content:
With
path
being the interesting part, of course.On my machine, that file is located in:
And I believe it could be leveraged at the very least for configuration, or serve as the standard source for vault locations:
I am not 100% sure whether this file exists on every system in the same location, but it could also be a best-effort thing that could be ignored if the file is not found.
At least this is the way I implemented it in my personal extension, and I do recognize that most people do not "spam vaults" like I do 😄 But if you're interested, this could at least make onboarding for this extension a bit smoother, and for my use case, a setting to track vaults using this file would be great.
If you give me the go ahead and a quick outline of what you'd like to see, I could also try to implement this.