How to access space data from Space Lua?

I managed to give the hot fresh space-lua a try but I failed to find a way to access space data from it (it’s not documented anywhere AFAIK). How can space data be accesses (pages, tables, tags, …) from the space-lua? Quickly skimming over SB source code also didn’t helped me as much as I hoped. Is accessing space data from space-lua yet possible? (P.S. This thread should probably be moved to the Edge channel but I was not sure, so asking in General.)

Space Lua is in fairly early development so there’s no docs nor examples yet. That said, all syscalls are currently exposed, including those to e.g. read and write pages and attachments. Here’s an example from the docs actually: Space Lua

local function call_some_things()
  local text = space.read_page(editor.get_current_page())
  print("Current page text", text)
end

I’ve already seen the existing documentation. It does not clarify (to me) how to access for example a table data from some space page. Also, I would suppose that the following code should work, but it does not seem to.

# Space Lua Test

```space-lua
function test()
  return space.list_pages()
end
```

${test()}

What am I doing wrong? And what would be supposed to appear in this particular case when list is to be returned? I assume that it would be influenced by the selected renderer, right? For instance, it will return Markdown list if output was set to Markdown?

I also tried to return

return space.get_space_meta(editor.get_current_page())

But without any success, I got just empty output from the ${test()} call. I must be doing something wrong, IMHO. :slight_smile: