summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Lua/Marshal
AgeCommit message (Collapse)Author
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.
2022-06-15Use dev version of citeproc.John MacFarlane
2022-03-30Lua: allow to pass Sources to pandoc.read (#8002)Albert Krewinkel
Sources, the data type passed to the `Reader` function in custom readers, are now accepted as input to `pandoc.read`.
2022-03-29Remove redundant dependency on hslua-marshalling.Albert Krewinkel
The package is a dependency of hslua; all important modules are re-exported.
2022-02-19Relax upper bound for hslua, allow hslua-2.2. (#7929)Albert Krewinkel
Lua 5.4 is used by default after this is merged. Packagers may still include Lua 5.3 instead by building pandoc with `--constraint='hslua <2.2'`. Differences between 5.3 and 5.4 should not generally affect pandoc Lua filters. See list of incompatible changes here <https://www.lua.org/manual/5.4/manual.html#8.1>
2022-01-29Switch to hslua-2.1Albert Krewinkel
This allows for some code simplification and improves stability.
2022-01-04Lua: marshal templates as opaque userdata valuesAlbert Krewinkel
2022-01-04Lua: add `pandoc.WriterOptions` constructorAlbert Krewinkel
2022-01-02Copyright notices: update for 2022Albert Krewinkel
2022-01-01Lua: provide global `PANDOC_WRITER_OPTIONS` [API change]Albert Krewinkel
API changes: - The function T.P.Filter.applyFilters now takes a filter environment of type `Environment`, instead of a ReaderOptions value. The `Environment` type is exported from `T.P.Filter` and allows to combine ReaderOptions and WriterOptions in a single value. - Global, exported from T.P.Lua, has a new type constructor `PANDOC_WRITER_OPTIONS`. Closes: #5221
2022-01-01Lua: marshal ReaderOptions field `extensions`, `track_changes` via JSONAlbert Krewinkel
Extensions are now available as a list of strings; the track-changes settings are given as the kebab-case representation used in JSON.
2021-12-31Lua: cleanup stack in peekReadOptionsTableAlbert Krewinkel
A ReaderOptions element was left on top of the stack when the `peekReadOptionsTable` function was invoked.
2021-12-20Lua: use more natural representation for Reference valuesAlbert Krewinkel
Omit `false` boolean values, push integers as numbers.
2021-12-17Lua: add function `pandoc.utils.references`Albert Krewinkel
List with all cited references of a document. Closes: #7752
2021-12-11Custom reader: pass list of sources instead of concatenated textAlbert Krewinkel
The first argument passed to Lua `Reader` functions is no longer a plain string but a richer data structure. The structure can easily be converted to a string by applying `tostring`, but is also a list with elements that contain each the *text* and *name* of each input source as a property of the respective name. A small example is added to the custom reader documentation, showcasing its use in a reader that creates a syntax-highlighted code block for each source code file passed as input. Existing readers must be updated.
2021-11-27Lua: use package pandoc-lua-marshal (#7719)Albert Krewinkel
The marshaling functions for pandoc's AST are extracted into a separate package. The package comes with a number of changes: - Pandoc's List module was rewritten in C, thereby improving error messages. - Lists of `Block` and `Inline` elements are marshaled using the new list types `Blocks` and `Inlines`, respectively. These types currently behave identical to the generic List type, but give better error messages. This also opens up the possibility of adding element-specific methods to these lists in the future. - Elements of type `MetaValue` are no longer pushed as values which have `.t` and `.tag` properties. This was already true for `MetaString` and `MetaBool` values, which are still marshaled as Lua strings and booleans, respectively. Affected values: + `MetaBlocks` values are marshaled as a `Blocks` list; + `MetaInlines` values are marshaled as a `Inlines` list; + `MetaList` values are marshaled as a generic pandoc `List`s. + `MetaMap` values are marshaled as plain tables and no longer given any metatable. - The test suite for marshaled objects and their constructors has been extended and improved. - A bug in Citation objects, where setting a citation's suffix modified it's prefix, has been fixed.