Transclusion of external resources

Hi,
I want to transclude external resources like

ex: include external markdown in my page
![[https://raw.githubusercontent.com/dair-ai/Prompt-Engineering-Guide/refs/heads/main/pages/techniques/zeroshot.en.mdx]]

Is it possible? (standard, custom method)

Many thanks

I think what you are looking for is Federation

It‘s set to be removed in future versions of silverbullet tho

To future proof you could use lua to fetch the page and then embed as markdown using widget.new

1 Like

This is what I was hinting about in the chat as well. I just couldn’t find the right way to tender the MD as HTML.

Federation seems great but obsolet but it doesn’t work on edge.
lua is not stable and I can’t spend hours to develop this feature. It’s not enough mature.

Even though it’s in development, I wouldn’t say it isn’t stable enough yet to create a small transclusion function:

transclude = function(url)
  local result = http.request(url)
  return widget.new { markdown = result.body }
end

Or if you’re not on the Edge-version:

transclude = function(url)
  local result = http.request(url)
  return { markdown = result.body }
end

That you can then use as such:

${ transclude "https://raw.githubusercontent.com/dair-ai/Prompt-Engineering-Guide/refs/heads/main/pages/techniques/zeroshot.en.mdx" }

Note: it only works when you can reach your SilverBullet server. When I’m not on my home network it shows: Lua error: offline, because http.request proxies the request via the SilverBullet server.

thanks for the code snippet.

but request return an array and it’s not working.

After a refresh, sometimes is ok.

I don’t know yet if it’s a problem of client or server

On the Edge version, I also get the int array. That might be a regression.
On 0.10.4, I do get the body back.

I’ll file a report on GitHub. :slight_smile:
Edit: issue can be found here.

Thanks for your help.

Like I say, by experience is not always simple.

I have swtich to edge to have a fix of regressiion but It has not been released and published.

Are there some ideas or current process to have:

  • stable version
  • pre-release version (with fixes) or to publish quickly fixes (make releases on stream for fixes)
  • edge (next-version)

What is the test coverage of SB

SB is very interesting and community is awesome and like the coder side of the product.
But on another hand, It’s not easy to gain SB skills because it’s changing quickly, many regressions appear, because a large custom features, it’s difficult to find documentation.

I have doubt about a long term use. I spend to many time to add feature , to debug, to fix.
To my mind and to be popular, Sb have to reach some maturity and stability.
Lambda people want to have a stable note-taking application. The coder side is a big plus but after basics.
I understand that it’s a difficult goal to reach for open software that why I will continue to use it and invert time on it a couple of month and after that I will take a decision about its use.

Disclaimer: I’m an optimist :smiley:

Stability is definitely important. I used to develop a relatively popular plug-in for Foundry VTT, but the product was changing too fast at the beginning for me to keep up.

I have high hopes for v2.0.0. Removing a large part of the code base is going to hurt part of the current userbase, but it’s going to have a long lasting benefit of fewer issues and improved focus. Lua is very flexible/expressive, so I predict that SilverBullet will fulfill its promise of a light and stable base with great extensibility.

For serious use, I simply create plain markdown pages with a couple of queries at the moment. I have a separate space to tinker with more complicated things. When the dust of development settles a bit, I also feel more at ease to utilize more of its power in my ‘production’ notes.

1 Like