Space Lua: Making Space Script safer, simpler and unifying all the things

That is so exciting man. I’ve been seeing commits about space-lua for a few days and looking it works is so exciting. Great job zef!

One thing I notice is that the demonstrated syntax is not 100% lua right? It is using semicolon for key-value pairs in the table.

Yeah that’s valid Lua syntax, you can use either commas or semicolons

Started some documentation: Space Lua

Subject to deep change. Still figuring out what this can and should do and what the APIs should look like.

@zef Absolutely cool! Looking forward to it!

(BTW: the marquee tag is obsoleted.)

It will never be obsolete in my heart.

It’s the first cool thing I did when learning HTML haha

Hey Zef, do you think it is easier to accept the valid lua file instead of embed in the markdown block so we can use our own editor with completion and other functionalities?

Out of couriosity I did a few experiments with LUA in Silverbullet and despite having pretty small knowledge about it, yet, I like it very much!
Especially the Widget style is very handy (in fact, I missed something like that before).
And defining global functions is much more easy now, too.

However, I did not get, how to access objects like page, tags, tables, own objects and so on.
Could you please add some examples to the space-lua-documentation, too?

Thanks :slight_smile:

Thanks!

Accessing those things is not very easy yet. I’m still thinking what’s the best way to expose this.

Oh, I was afraid, that you answer something like that :wink:

So I have to be patient…
But I’m absolutely looking forward to use LUA instead of template language (which in my eyes is a bit complicated) and concentrate on only one language for “everything” (at least within Silverbullet).

I am champing at the bit :slight_smile:

Alright people. I recorded a video on the current state, including a demo:

Thanks a lot for this thread, as I'm enjoying digging into SB's history and I found this thread today when I retook a conversation with a peer from the Malleable Systems community about Fengari and I was looking if it was already considered in relation with Space Lua. And yes, it was, despite I don't have the proper background to understand (Dr ;-P) @zef's initial stopper with already existing Lua in the web, implementations when he said:

But, of course, I trust his judgement, as Space Lua proves to be another successful Lua extension story within the particular historic constrains of SB.

Which brings me to @Maarrk remarks regarding:

as I'm facing questions on full compatibility with Lua to see if I can make SB backward compatible with Cardumem, the Lua based static site generator, I'm creating to support our previous/current documentation/publishing workflows, while dealing with Markdown's popularity and insufficiency and its several "variants in the wild", mainly Pandoc's, HedgeDoc's, Lunamark's and now SB's, that deal with the format limitations in distinct ways.

Specifically, I would like to reuse the lessons I learnt[*] while supporting Markdown customizations using Lua Parser Expression Grammars (LPEG) and move them from Lunamark to SilverBullet. But, because of non-full compatibility with Lua, that seem not possible so far. So, I'm thinking in the the opposite approach, that has been successful so far: support (parts of) SilverBullet syntax in Cardumem (starting with transclusions and title links), given that there I have full Lua support and keep exploring the complementary relation between (dynamic) SB and (static) Cardumem. @Maarrk question on how SB could read a folder of Lua scripts was also on my radar, as adding Cardumem to an already existing Markdown documentation project is essentially adding the Lua scripts that make it work (via downloads and Luarocks).

I'll keep you posted as I advance my exploration on how to make SB part of a pre-existing workflow of Markdown/Lua powered documentation/publishing workflows.

Thanks again for this rich story and the public record/reflection on SB design and its community usage/tensions.

Cheers,

== Note(s)

[*] I'm learning Lua with Cardumem and (very) slowly LPEGs too. My sense of resonance between Cardumem and SB is increased in the fact that this thread on supporting Lua as its extension language ended just weeks before my first commit on Cardumem and I wouldn't have rediscovered SB, if Lua hadn't become its extension language... ahh the power of serendipity.