New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make pandoc behave like a Lua interpreter when called as pandoc-lua
.
#8311
Conversation
Todo:
|
Nice. Is an interactive REPL possible? |
If we had a REPL, it might be worth adding some fancy pretty-printing of the userdata Haskell values, similar to https://github.com/wlupton/pandoc-lua-logging |
I'd like to do a REPL-less version first to avoid the need for an additional library (like haskeline). But it would be great to add one if the extra dependencies turn out to be small. |
I think you'd add the following dependencies with haskeline: |
c846dd7
to
caa329a
Compare
The current state is quite usable already and ready to merge from my side. I plan to write a "hslua-cli" package, with a proper REPL, in the not-too-distant future. But I'd like to finish some other things first (e.g., Markdown tables). |
02eae65
to
c4e6d58
Compare
Can you add a |
Done. 👍 BTW, to avoid complications, I'd like to limit support of the hslua-cli package to Lua 5.4. This would mean that we'd need to drop support for the |
pandoc-lua
.pandoc-lua
.
pandoc-lua
.pandoc-lua
.
I've extracted most of the code to the new package hslua-cli and fixed some more issues along the way. I'm dabbling with haskeline and may try isocline as well. |
A program name of
pandoc-lua
, e.g., when the binary was invoked through a symlink with that name, will make pandoc behave like a Lua interpreter: the first command line argument is run as a Lua script, and the remaining arguments are passed to the interpreter in the global tablearg
. Lua options are not supported yet.