Hi, was starting to dig in to the new plugins (with the hope that I could build off a basic one), so I figured I'd test one out first to see how they worked. Wasn't able to get it working, so I thought I'd share the steps I took in case it helps with documentation. I read some of the developer tutorial and this page https://joplinapp.org/plugins/
What I tried (attempting to get the TOC working)
Copied code to a toc folder inside a plugin folder inside joplin-desktop.
It was unclear what files I needed, especially since the readme seems to be boilerplate. Tried the 4 from the src file and the whole folder. Neither worked after restarting.
Tried setting an explicit development plugin path in Preferences.
Joplin 1.3.2 (prod, darwin) Mac
Sorry if I'm missing something obvious, excited to play with plugins.
Looking at the plugin getting started document, I think you always need to specify the plugin path (which I can see you tried). And the folder in the path needs to contain a dist folder with the compiled plugin. I think you missed the compilation step. It looks like a few of the example plugins are already compiled but not the toc example.
You can find the build steps in the getting started document I linked above.
Sorry for not being more detailed, I just have my phone right now and couldn't confirm any of what I'm saying. I have played around with plugins already though (they do work), but I'm a bit fuzzy on the details. I hope you can get the plugins running on your computer!
Besides what Caleb mentioned, perhaps one issue is that the directory should be called "plugins" and not "plugin".
Also as the details are still being worked on, the best way for now to load a plugin is to add it to the "Plugins" section in the Config screen. When it's loaded that way it will display a console on startup which might help understand what's happening.
Can this field accept a relative path to a folder within the profile directory? Any examples I have seen have all been absolute paths. I could only get your "SideBarToggle" plugin working on Windows 10 with an absolute path but that's a bit awkward for the portable version.
Currently not as this field is mostly for development, where you expect the plugin to be always in the same place. Otherwise, you can simply put the plugin in the "plugins" directory and it will be auto-loaded when the app starts and that should work with the portable app too.
Great, thanks. So, if plugins/FILE.js is found, it won't load plugins/SUBDIR/FILE.js or will the second override the first and so on?
Usually that shouldn't be a problem, since SUBDIR should have the .ts files and the dist dir the js files.
But it could still happen...
Ok, this means something like this will most likely result in an error:
Because you can't register the same plugin twice. It's not a problem, just something people should be aware of.
Depending on the algorithm, plugins/toc/index.js is loaded and plugins/toc/dist/index.js will be a silent error, thus the first one is active.
Or it could mean that plugins/toc/dist/index.js overwrites plugins/toc/index.js and thus the second one is active.