I’m trying to use Luerl to import an external Lua library that claims to be compatible with Lua 5.1-5.4 with no other external dependencies, djot.
There isn’t much documentation on how to load external modules, so I played around a bit.
Given the following test.lua
file:
local djot = require("djot")
local input = "This is *djot*"
local doc = djot.parse(input)
local html = djot.render_html(doc)
print(html)
I checked out djot
inside /tmp/playground
so the Git repo ends up in /tmp/playground/djot
. I then tried luerl:evalfile
with a custom path, which seems to load all modules, but later gets a weird error:
1> os:putenv("LUA_PATH", "/tmp/playground/?/?.lua;/tmp/playground/djot/?.lua").
true
2> luerl:evalfile("test.lua", luerl:init()).
{error,function_clause,
[{luerl_heap,raw_set_table_key,
[{tref,81},
<<"s">>,<<"This is ">>,
{luerl, ...
Is this a bug? Am I using the wrong API?
Not sure how to proceed here. I couldn’t find much documentation on how to load external Lua libraries with luerl…
(cc @DianaOlympos )