New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Shell commands plugin #433
Conversation
|
Should consistently use imports for this, right? https://github.com/Taitava/obsidian-shellcommands/blob/93a46097410111d83ba7dc8988943f042bc7ca1c/Common.ts#L6 if (adapter instanceof FileSystemAdapter) {
return adapter.getBasePath();
}
return null;https://github.com/Taitava/obsidian-shellcommands/blob/93a46097410111d83ba7dc8988943f042bc7ca1c/Common.ts#L14
https://github.com/Taitava/obsidian-shellcommands/blob/93a46097410111d83ba7dc8988943f042bc7ca1c/ShellCommandVariableParser.ts#L90 https://github.com/Taitava/obsidian-shellcommands/blob/93a46097410111d83ba7dc8988943f042bc7ca1c/ShellCommandVariableParser.ts#L230 |
|
Thanks, I will look into these! :) |
I tried to learn Promises now, but wasn't succesful to figure out how they work :(. This is something I need to look into later. Everything else should be fixed now. Please let me know if there's still something to fix :). P.S. The current released version Edit: Whoops, tried, not tired :D |
|
https://github.com/Taitava/obsidian-shellcommands/blob/19a742c494be9d725b290859d14713118f86b5e4/Common.ts#L19
Ah yes - promises is the replacement for callbacks, but I think in your case since the rest of your code isn't designed for async processing this may not work very well - since you're targeting the desktop app anyway, using the electron API should be fine. I am ready to merge this - let me know when you make the release! |
So something like this? if (view_mode) {
if ("editor" in view) {
// Good, it exists.
// @ts-ignore We already know that view.editor exists.
return view.editor;
}
}
// Else: either view_mode is false-ish, or view didn't contain editor. Write to log and return null.I have written this function a bit badly: it checks if the view mode is "source". And btw what is "live" view mode? Thanks! :) I'll let you know when I have the release ready. |
|
Oh no, I wasn't clear - you'll want to make sure that the |
|
Thanks :). Now I've released version |
I am submitting a new Community Plugin
Repo URL
Link to my plugin: https://github.com/Taitava/obsidian-shellcommands
Release Checklist
main.jsmanifest.jsonstyles.css(optional)v)idin mymanifest.jsonmatches theidin thecommunity-plugins.jsonfile.