diff options
author | Ian Max Andolina <iandol@users.noreply.github.com> | 2020-10-08 17:56:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-08 11:56:08 +0200 |
commit | d1e1898c5226d334f49fafb829f79508161108dc (patch) | |
tree | 8054e6cb3db18cc5207636d4f71784590520c91a /doc/lua-filters.md | |
parent | 1be0f0fba8d860b960e79442a891fce6b1aca192 (diff) | |
download | pandoc-d1e1898c5226d334f49fafb829f79508161108dc.tar.gz |
Add info on how to debug Lua filters (#6732)
Add info on debugging Lua filters.
Diffstat (limited to 'doc/lua-filters.md')
-rw-r--r-- | doc/lua-filters.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 7cba5e3a9..8ce427a5d 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -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 |