twibiral / obsidian-execute-code

Obsidian Plugin to execute code in a note.
MIT License
1.06k stars 67 forks source link

Fix/file extensions #268

Closed mayurankv closed 10 months ago

mayurankv commented 1 year ago

Small changes so that the values for file extensions as set in settings are respected in main (avoiding duplication).

mayurankv commented 1 year ago

If it would be beneficial I would be happy to start working on a PR to convert the settings interface into something a bit more parseable. i.e. add an interface like below for each language with only path required. If args or inject doesn't exist, assume it is "" and if fileExtension doesn't exist, assume it is the same as the language etc. Maybe interactive should be required, but the idea is pretty similar. Let me know!

export interface LanguageSettings {
    path: string;
    args?: string;
    fileExtension?: string;
    inject?: string;
    interactive?: boolean;
    embedPlot?: boolean;
    useMain?: boolean;
}
twibiral commented 1 year ago

Hi @mayurankv, thank you a lot for your contributions! I really appreciate them. At the moment, I don't have a lot of time for working on the plugin, unfortunately. I will have much more time in two months or so. Then I will merge your contributions and create a new release.

As you probably saw when working on the plugin, there is some weird code or architecture decisions. This is because I started with JavaScript and Python only, but a lot of incredible contributors extended the software with cool new features that were not planned orignally. This built on the insufficient original architecture and led to some not so perfect code.

Just one note: Please don't try to merge into the master branch and merge instead into develop. The master branch should always only contain the last release version.

mayurankv commented 1 year ago

Hi @twibiral. No worries, it's my first foray into obsidian plugins so it's been an interesting learning experience. Of course I totally understand that you're quite busy. I'll probably refrain from starting work on a refactor for now (unless I find myself with a fair amount of free time). But please do let me know if there's things I could do to help, I find this plugin super useful and appreciate it loads!

I've changed the existing PRs I've made to develop now.

twibiral commented 10 months ago

Hi @mayurankv , thank you so much for all the work you put into the plugin, I really appreciate it! I opened a new issue #300 to discuss the refactoring of the settings, feel free to add your ideas/comments

mayurankv commented 10 months ago

Thanks, I'm also quite busy currently but I'll definitely add any ideas!