On Thursday, October 5, 2023 at 6:19:10 AM UTC-4 Albert Krewinkel wrote:
That's elegant. Another way to get the value of `myDir` would be
local myDir = pandoc.path.directory(arg[0])
and should also work on all platforms. It relies on pandoc's built-in
path library and on a feature of the default lua interpreter, which
pandoc replicates for compatibility:
https://www.lua.org/manual/5.4/manual.html#7
I find with pandoc 3.1.8 that while `arg` is defined for a script executed with `pandoc lua`, it is nil for a filter executed with `pandoc -L`. So I'm back to my borrowed elegant solution.