git.iko.soy/typeable/pandoc
on master help sign in
Add info on how to debug Lua filters (#6732)

Add info on debugging Lua filters.

commitd1e1898c5226d334f49fafb829f79508161108dc authorIan Max Andolina <iandol@users.noreply.github.com> dateThu 8 Oct 2020, 17:56 (6 years ago) parent1be0f0f
1 file changed+19
doc/lua-filters.md+19
doc/lua-filters.md+19
@@ -305,6 +305,25 @@ end
305305This makes it possible to apply these functions on strings using
306306colon syntax (`mystring:uc_upper()`).
307307
308+# Debugging Lua filters
309+
310+It is possible to use a debugging interface to halt execution and step through a
311+Lua filter line by line as it is run inside Pandoc. This is accomplished using
312+the remote-debugging interface of the package
313+[`mobdebug`](https://github.com/pkulchenko/MobDebug). Although mobdebug can be
314+run from the terminal, it is more useful run within the donation-ware Lua editor
315+and IDE, [Zerobrane](https://studio.zerobrane.com/). Zerobrane offers a REPL
316+console and UI to step-through and view all variables and state.
317+
318+If you already have Lua 5.3 installed, you can add
319+[`mobdebug`](https://luarocks.org/modules/paulclinger/mobdebug) and its
320+dependency [`luasocket`](https://luarocks.org/modules/luasocket/luasocket) using
321+[`luarocks`](https://luarocks.org), which should then be available on the path.
322+Zerobrane also includes both of these in its package, so if you don't want to
323+install Lua seperately, you should add/modify your `LUA_PATH` and `LUA_CPATH` to
324+include the correct locations; [see detailed instructions
325+here](https://studio.zerobrane.com/doc-remote-debugging).
326+
308327# Examples
309328
310329The following filters are presented as examples. A repository of