aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Custom.hs
AgeCommit message (Collapse)AuthorFilesLines
2021-12-11Custom reader: ensure old Readers continue to workAlbert Krewinkel1-16/+47
Retry conversion by passing a string instead of sources when the `Reader` fails with a message that hints at an outdated function. A deprecation notice is reported in that case.
2021-12-11Custom reader: pass list of sources instead of concatenated textAlbert Krewinkel1-6/+4
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-06Pass ReaderOptions to custom readers as second parameter.John MacFarlane1-4/+3
2021-11-05Add interface for custom readers written in Lua. (#7671)John MacFarlane1-0/+55
New module Text.Pandoc.Readers.Custom, exporting readCustom [API change]. Users can now do `-f myreader.lua` and pandoc will treat the script myreader.lua as a custom reader, which parses an input string to a pandoc AST, using the pandoc module defined for Lua filters. A sample custom reader can be found in data/reader.lua. Closes #7669.