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.
From now on I will publish versions via GitHub releases, so you can install the more stable version via:
ghr:janssen-io/silverbullet-external-libraries
The old install ālinkā will still work, but it will download the development version. This version is less thoroughly tested and might be less stable.
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.
The main branch (github: syntax) of the plug is compatible with Edge.
The releases (ghr: syntax) is compatible with 0.10.4/stable.
If there are issues because of changes on Edge, I will fix them as soon as possible on the main branch.
Once a new version of SilverBullet is released as stable, I will also create a new release of the plug. (But hopefully once v2 is officially released, it will be part of SilverBullet itself)