External libraries from SB community

Big thanks to @zef — it’s now super easy to share Space Lua scripts through GitHub!

I thought it’d be nice to have a single place where we can collect everyone’s repositories and make it easier to:

  • Discover cool scripts made by others
  • Share your own work
  • Collaborate or remix ideas

Whether it’s a simple helper script, a custom command, or a full-blown plugin everything’s welcome! The more we share, the faster we all level up :flexed_biceps:.

Got your own repo? Drop the link below so others can explore it! Let’s build a solid Space Lua community together.

Full updated script list:

6 Likes

I like this approach :+1:

Thanks for the mention! I should update the readme with the new way of integrating scripts from GitHub and archive the external-libraries plug.

Another common way is to have an awesome-silverbullet repo (maybe in the silverbullet organisation on GitHub?) that lists everything, but if that’s not maintained actively, it can be a bit of a bother to add new links.

1 Like

@malys thanks for this list! It would be super cool if you could keep it updated over time.

The must to have could be to auto update the 1st post with api and to put the list of updated scripts with repository name.

Why not make a PR to the main repository for silverbullet librarieshttps://github.com/silverbulletmd/silverbullet-libraries?
It makes more sense to have everything in one place, doesn’t it?

Here are a two reasons why this might not be the best idea:

  • Not every library is useful for everyone. If everyone started submitting their libraries to the official repository, it would sooner or later be filled with a lot of “junk” or random snippets.
  • Personally, I prefer to maintain my own repository of silverbullet-libraries independently, without having to create a PR for every single commit I make (which, admittedly, happens more often than I’d like). Submitting PRs to the main repo would also create a lot of unnecessary work for @zef.

As an alternative, it might make more sense to submit PRs only to the official silverbullet-libraries repository and include only links to each fork, similar to what @malys is doing here. Instead of posting these in the forum, we could create a list on GitHub and include the links to each creator’s personal fork in the README.
This would keep the maintenance effort for @zef minimal while giving everyone the flexibility to maintain their own repository, and still everything being “registered” in a central repo.

1 Like

In my repository, there is json file with SB libraries. Enriching It, It could be the database of all scripts and SB could fetch It and directly to install délecter script from specific SB ui.

1 Like

I understand what you mean, but it’s not my philosophy of FLOSS. contribute and enhance the software you like.
I think all scripts you have created are useful for someone in the world. like any plugins store, anyone can activated the plugs they need (like logseq plugins).
but for that, it useful the search in one place and not deep searching in the forum threads or in all github repos.
if we keep SB simple as possible, more people can contribute and enhance it

@zef what do you think?

I have tried to create PR to official sb-libraries but I think it to complicate:

  • I’m not the owner of my own code
  • it’s most complicate to maintain them (time-consuming PR, validation, review)

In this case, my goal is not to contribute to SB core but:

  • to share scripts (no pains that cover my needs)
  • to share ideas
  • to fix some bugs from feedbacks and collaborative improvements.

I try to write scripts quickly to cover missing features and to not spend hours on it (after on 1 year, I conclude that maintenance of scripts are costly).
It’s not very easy to be productive writing space-lua. Step by step, I try to improve code quality but currently, my scritps is “Use as is, not guaranteed”. If someone want to use them, improve them or be inspired by them. Perfect!

That’s why have my own public sb-libraries repository is a right solution for me..
I will try to update this post with new repositories.

1 Like

I wrote this “little” Import workflow:

You only configure your favorite repos and paths where you want to import the libraries from, similar to plugs :

config.set {
    silverbulletLibraries = {
      {"silverbulletmd/silverbullet-libraries",""},
      {"Mr-xRed/silverbullet-libraries",""},
      {"malys/silverbullet-libraries","src"},
      {"janssen-io/silverbullet-libraries","Library"}
    }
}

When you execute the command:

  1. Select repo - choose from predefined GitHub repositories.
  2. Browse contents - folders shown first; drill down recursively.
  3. Select file - only .md files are accepted.
  4. Fetch content - download the raw Markdown from GitHub.
  5. Choose save path - suggested based on filename
  6. Save & import - write page locally and navigate to it.
  7. Update frontmatter - with source URL (so it can be updated later)

And here a short video of a sneak preview, to see it in action:

I also put a query and a made a Check Update Status command, so you can check if all your imported libraries are the latest.

This could streamline the Importing/Updating process, we just need to keep an updated list of the repositories.

What do you think? any improvements? Ideas? Features? or am i just overcomplicating simple things?

1 Like

Oh my god that’s so cool! Did you do this in Space Lua or a plug?

100% space-lua

i need to make some tiny modifications and then I can push it to my repo, and you can check it out.
the only downside of this approach is that github lets you do only 60 API calls / hour without authentication. So one would need an API Key to have 5000 API calls/hour (more than enough).

Every browsing/navigation makes one separate API call. so one library import could “cost you” 2+ API calls depending on the depth of the .md file you’re looking for. But for the average Joe that is more than enough imho. But for us “geeks” we’d definitely will need an API_KEY added. but that’s just a minor inconvenience.

I was thinking to what degree we can build actual UIs this way, and this shows you can :smiley:

definitely we could even intergate buttons for “Update” “Delete” directly in the table.

but for now that’s not possible due to the widget bug in rendered tables:

[Edit]
just added following issue on GitHub with the hope someone could solve this:

Amazing! I’m on holidays. i send your quick answer.
Imagine every SB libraries generates index.json ( md list files with description, owner , licence, URL)
Your lua script get by default index.json of GitHub repository and if not scan repository

Like this your save many GitHub API calls.

We have to be agree on the format and push tooling on official SB libraries. Every fork will inherit them.

That sounds nice, but you lost me after the second line…
First enjoy your holiday, and after you’re back we can discuss this further :wink:
glad you like it.