aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Lua/PandocLua.hs
AgeCommit message (Collapse)AuthorFilesLines
2021-11-27Lua: use package pandoc-lua-marshal (#7719)Albert Krewinkel1-22/+3
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.
2021-10-29Lua: use hslua module abstraction where possibleAlbert Krewinkel1-8/+0
This will make it easier to generate module documentation in the future.
2021-10-22Switch to hslua-2.0Albert Krewinkel1-17/+16
The new HsLua version takes a somewhat different approach to marshalling and unmarshalling, relying less on typeclasses and more on specialized types. This allows for better performance and improved error messages. Furthermore, new abstractions allow to document the code and exposed functions.
2021-08-24Text.Pandoc.Class: add readStdinStrict method to PandocMonad.John MacFarlane1-0/+1
[API change]
2021-08-24Lua subsystem and custom writers: generalize types from PandocIO...John MacFarlane1-3/+2
to any instance of PandocMonad and MonadIO. This involves an API change, since the type of runLua is now (PandocMonad m, MonadIO m) => Lua a -> m (Either PandocError a)
2021-01-26Lua: always load built-in Lua scripts from default data-dirAlbert Krewinkel1-12/+19
The Lua modules `pandoc` and `pandoc.List` are now always loaded from the system's default data directory. Loading from a different directory by overriding the default path, e.g. via `--data-dir`, is no longer supported to avoid unexpected behavior and to address security concerns.
2021-01-08Update copyright notices for 2021 (#7012)Albert Krewinkel1-1/+1
2020-04-17API change: use new type PandocLua for all pandoc Lua operationsAlbert Krewinkel1-0/+134
The new type `PandocLua` is an instance of the `PandocMonad` typeclass and can thus be used in a way similar to `PandocIO`.