aboutsummaryrefslogtreecommitdiff
path: root/pandoc-lua-engine/src/Text/Pandoc/Lua
AgeCommit message (Collapse)Author
2022-10-10Lua: support custom bytestring readers.Albert Krewinkel
2022-10-10Lua: use `Reader` type for custom readers.Albert Krewinkel
2022-10-08[API Change] Change argument type of `getReader`, `getWriter`.Albert Krewinkel
The functions now take a `FlavoredFormat` instead of a text argument.
2022-10-08[API Change] Add new module "Text.Pandoc.Format"Albert Krewinkel
The module provides functions and types for format spec parsing and processing. The function `parseFormatSpec` was moved from Text.Pandoc.Extensions to the new module and renamed to `parseFlavoredFormat`. It now operates in a PandocMonad and is based on the updated types.
2022-10-06Lua: cleanup module dependenciesAlbert Krewinkel
Ensures a cleaner module dependency graph.
2022-10-05Lua: produce more informative error messages for pandoc errorsAlbert Krewinkel
Errors are reported in Lua in the same words in which they would be reported in the terminal.
2022-10-04Lua: add new module `pandoc.format`.Albert Krewinkel
The module provides functions to query the set of extensions supported by formats, and the set of extension enabled per default.
2022-10-04Lua: ensure that extensions marshaling is consistent.Albert Krewinkel
2022-10-03Separate out T.P.Data, T.P.Translations from T.P.Class. (#8348)John MacFarlane
This makes T.P.Class more self-contained, and suitable for extraction into a separate package if desired. [API changes] - T.P.Data is now an exported module, providing `readDataFile`, `readDefaultDataFile` (both formerly provided by T.P.Class), and also `getDataFileNames` (formerly unexported in T.P.App.CommandLineOptions). - T.P.Translations is now an exported module (along with T.P.Translations.Types), providing `readTranslations`, `getTranslations`, `setTranslations`, `translateTerm`, `lookupTerm`, `readTranslations`, `Term(..)`, and `Translations`. - T.P.Class: `readDataFile`, `readDefaultDataFile`, `setTranslations`, and `translateTerm` are no longer exported. `checkUserDataDir` is now exported. - Text.Pandoc now exports Text.Pandoc.Data and `setTranslations` and `translateTerm`.
2022-10-03[API Change] Support bytestring custom writers.Albert Krewinkel
New-style custom Lua writers can now define an alternative entry function `BinaryWriter`. If a function with that name is defined, then pandoc will treat the returned string as binary output. This allows to generate formats like docx and odt with custom writers.
2022-10-03[API Change] Base custom writers on Writer type.Albert Krewinkel
The `T.P.Lua.writeCustom` function changed to allow either a TextWriter or ByteStringWriter to be returned. The global variables `PANDOC_DOCUMENT` and `PANDOC_WRITER_OPTIONS` are no longer set when the writer script is loaded. Both variables are still set in classic writers before the conversion is started, so they can be used when they are wrapped in functions.
2022-10-03Lua: add function `pandoc.write_classic`.Albert Krewinkel
The function can be used to convert a classic writer into a new-style writer by setting it as the value of `Writer`: ``` lua Writer = pandoc.write_classic ``` or to fully restore the old behavior: ``` lua function Writer (doc, opts) PANDOC_DOCUMENT = doc PANDOC_WRITER_OPTIONS = opts load(PANDOC_SCRIPT_FILE)() return pandoc.write_classic(doc, opts) end ```
2022-10-03Lua: Support running Lua with a GC-collected Lua state.Albert Krewinkel
2022-09-30[API Change] Extract Lua code into new package pandoc-lua-engineAlbert Krewinkel
The flag 'lua53` must now be used with that package if pandoc is to be compiled against Lua 5.3.