Closed simone-viozzi closed 2 months ago
Yes, that shouldn't be hard to add, but this makes the line between space script and plugs (https://silverbullet.md/Plugs) even more blurry. Effectively plugs do what you describe (although doing things like defining custom functions are a bit tricky to do from a plug at the moment, that can be fixed though).
Yes, I like the idea of using a Plug for external JavaScript.
I haven't looked into plugs, but I understand I cannot use the space script silverbullet.registerFunction
etc..?
In the end, I solved my use case by creating a plug: https://github.com/simone-viozzi/silverbullet-meeting-notes
Fell free to add it to the list of plugs if you want, but it's very specific for my use case.
I suggest enabling users to develop space scripts in external
.js
files before loading them into SilverBullet.This approach simplifies the development process, improves version control, and facilitates outside testing.
Additionally, this feature could allow developers to create a JavaScript library of pure functions, test it externally, and then integrate it with SilverBullet by wrapping these functions in SilverBullet-specific calls.