I’m excited to share a new plugin I’ve developed for SilverBullet. This plugin, External Libraries, allows you to seamlessly load pages from external sources like GitHub.
Key Features
Easy Distribution: Effortlessly share templates, themes, scripts, and commands.
Integration with GitHub: Load content directly from GitHub repositories. Content can also be previewed by hosting the shared markdown files on GitHub Pages.
Enhanced Collaboration: Simplify the process of distributing and using shared resources.
Why External Libraries?
The Library functionality in SilverBullet allows you to share content between SilverBullet instances. External Libraries allows you to use any platform where you can host files to share content.
Platform flexibility brings the following benefits:
Collaboration: This makes it easier to share community content such as themes, scripts and templates via a platform like GitHub, where others can also contribute.
Cost: No need to buy/rent a server and storage to share your content publicly.
Security: By using a third-party platform, you don’t need to worry about securing and maintaining your own server and network. You can safely keep your notes in a private SilverBullet instance.
Wow, this is really cool. Love the idea. I do wonder if this shouldn’t simply be merged into the core of SB though. To support both the federated libraries as before, as well as your more generic system.
What’s a bit of a shame usability wise, is that you still need to create an index.json file. Yes of course, you can automate the creation of this, but I’m wondering if it’s not somehow possible to leverage (some) Github API (for the GH resolver) that pulls a file list that way rather than depending on a static file in the repo. This may not be an option in general case (every resolver), but perhaps for some.
It would be a great addition to the existing plug or as an extra ‘default’ plug, I think. Might be good to make it slightly more consistent with the other default plugs. For example, I use gh://, whereas the plugs plug uses github:.
[Use the GitHub API instead of index.json]
I hadn’t even considered using the Github API as an alternative to the index.json. Seems pretty easy to use:
The ‘edge’ version of this plug has been updated to be compatible with the current ‘edge’ version of SilverBullet. Thanks, @zeus-web, for bringing up the issue!
Head’s up: in time (not sure how soon) I will remove the libraries functionality as it exists today (as it relies on federation, which I’ll also remove (Who's using federation? - #10 by zef)).
With your permission @janssen-io I’d then move to basically including what you built here, but baked into SB core as the new “blessed” way to distribute libraries, because I think it’s better than the old way (which was pretty hard to use, unless you deployed a public read-only SB instance).
That would be great, Zef! I can whip up a PR somewhere later this week hopefully, if you’d like.
If you think it’s better to add it yourself, then feel free to as well. I’m just looking for ways to contribute as I really love SilverBullet.
One thing to keep in mind:
Currently libraries do remove the entire folder first and then download the new ones. Mine just overwrites documents, but doesn’t delete ones that aren’t present anymore. So we might want to implement that still.