Add info on how to debug Lua filters (#6732)
Add info on debugging Lua filters.
This commit is contained in:
parent
1be0f0fba8
commit
d1e1898c52
1 changed files with 19 additions and 0 deletions
|
@ -305,6 +305,25 @@ end
|
|||
This makes it possible to apply these functions on strings using
|
||||
colon syntax (`mystring:uc_upper()`).
|
||||
|
||||
# Debugging Lua filters
|
||||
|
||||
It is possible to use a debugging interface to halt execution and step through a
|
||||
Lua filter line by line as it is run inside Pandoc. This is accomplished using
|
||||
the remote-debugging interface of the package
|
||||
[`mobdebug`](https://github.com/pkulchenko/MobDebug). Although mobdebug can be
|
||||
run from the terminal, it is more useful run within the donation-ware Lua editor
|
||||
and IDE, [Zerobrane](https://studio.zerobrane.com/). Zerobrane offers a REPL
|
||||
console and UI to step-through and view all variables and state.
|
||||
|
||||
If you already have Lua 5.3 installed, you can add
|
||||
[`mobdebug`](https://luarocks.org/modules/paulclinger/mobdebug) and its
|
||||
dependency [`luasocket`](https://luarocks.org/modules/luasocket/luasocket) using
|
||||
[`luarocks`](https://luarocks.org), which should then be available on the path.
|
||||
Zerobrane also includes both of these in its package, so if you don't want to
|
||||
install Lua seperately, you should add/modify your `LUA_PATH` and `LUA_CPATH` to
|
||||
include the correct locations; [see detailed instructions
|
||||
here](https://studio.zerobrane.com/doc-remote-debugging).
|
||||
|
||||
# Examples
|
||||
|
||||
The following filters are presented as examples. A repository of
|
||||
|
|
Loading…
Reference in a new issue