Commit graph

4 commits

Author SHA1 Message Date
Albert Krewinkel
75c791b4fe Lua filters: load module pandoc before calling init.lua (#5287)
The file `init.lua` in pandoc's data directory is run as part of
pandoc's Lua initialization process. Previously, the `pandoc` module was
loaded in `init.lua`, and the structure for marshaling was set-up after.
This allowed simple patching of element marshaling, but made using
`init.lua` more difficult:

  - it encouraged mixing essential initialization with user-defined
    customization;

  - upstream changes to init.lua had to be merged manually;

  - accidentally breaking marshaling by removing required modules was
    possible;

Instead, all required modules are now loaded before calling `init.lua`.
The file can be used entirely for user customization. Patching
marshaling functions, while discouraged, is still possible via the
`debug` module.
2019-02-09 13:56:49 -08:00
Albert Krewinkel
9a9c138d9c
data/pandoc.lua: re-export all bundled modules
All Lua modules bundled with pandoc, i.e., `pandoc.List`,
`pandoc.mediabag`, `pandoc.utils`, and `text` are re-exported from the
`pandoc` module. They are assigned to the fields `List`, `mediabag`,
`utils`, and `text`, respectively.
2019-02-09 20:12:33 +01:00
Albert Krewinkel
ef4351c4d2
data/init.lua: load pandoc.utils by default 2017-12-23 13:42:35 +01:00
Albert Krewinkel
4066a385ac
Lua filters: use script to initialize the interpreter
The file `init.lua` is used to initialize the Lua interpreter which is
used in Lua filters. This gives users the option to require libraries
which they want to use in all of their filters, and to extend default
modules.
2017-12-06 22:50:56 +01:00