aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Lua/Util.hs
AgeCommit message (Collapse)AuthorFilesLines
2018-10-01Lua filters: report traceback when an error occursAlbert Krewinkel1-2/+36
A proper Lua traceback is added if either loading of a file or execution of a filter function fails. This should be of help to authors of Lua filters who need to debug their code.
2018-10-01Lua Util: add missing docstring to defineHowToAlbert Krewinkel1-1/+1
2018-09-24Use hslua v1.0.0Albert Krewinkel1-55/+33
2018-08-12Lua: cleanup Lua utils, remove unused functions.Albert Krewinkel1-56/+28
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane1-0/+2
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-03-17hlint fixes.John MacFarlane1-1/+1
2018-01-23Lua filters: store constructors in registryAlbert Krewinkel1-2/+3
Lua functions used to construct AST element values are stored in the Lua registry for quicker access. Getting a value from the registry is much faster than getting a global value (partly to idiosyncrasies of hslua); this change results in a considerable performance boost.
2018-01-23Lua: move getTag from StackInstances to UtilAlbert Krewinkel1-3/+16
Change: minor
2018-01-12Lua filters: improve error messagesAlbert Krewinkel1-0/+9
Provide more context about the task which caused an error.
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-4/+4
2018-01-04Use hslua utils where possibleAlbert Krewinkel1-16/+0
Some helper functions and types have been moved to hslua. Change: minor
2017-12-29data/pandoc.lua: drop function pandoc.global_filterAlbert Krewinkel1-0/+1
The function `global_filter` was used internally to get the implicitly defined global filter. It was of little value to end-users, but caused unnecessary code duplication in pandoc. The function has hence been dropped. Internally, the global filter is now received by interpreting the global table as lua filter. This is a Lua API change.
2017-12-23Lua modules: add function pandoc.utils.normalize_dateAlbert Krewinkel1-0/+4
The function parses a date and converts it (if possible) to "YYYY-MM-DD" format.
2017-12-22Lua.Util: avoid altering the stack if peeking failsAlbert Krewinkel1-4/+12
The stack now remains unaltered if `getRawInt` or `getTable` fail. This is important when those functions are used in an operation that is part of an Alternative. Change: minor
2017-12-21Lua modules: move to dedicated submoduleAlbert Krewinkel1-2/+20
The Haskell module defining the Lua `pandoc` module is moved to Text.Pandoc.Lua.Module.Pandoc. Change: minor
2017-12-20Lua modules: turn pipe, read into full Haskell functionsAlbert Krewinkel1-3/+12
The `pipe` and `read` utility functions are converted from hybrid lua/haskell functions into full Haskell functions. This avoids the need for intermediate `_pipe`/`_read` helper functions, which have dropped.
2017-12-02Lua filters: refactor lua module handlingAlbert Krewinkel1-1/+32
The integration with Lua's package/module system is improved: A pandoc-specific package searcher is prepended to the searchers in `package.searchers`. The modules `pandoc` and `pandoc.mediabag` can now be loaded via `require`.
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-2/+2
2017-10-26update years in copyrightKolen Cheung1-1/+1
2017-08-13Text.Pandoc.Lua: Optimize performance by using raw table accessAlbert Krewinkel1-11/+6
Raw table accessing functions never call back into haskell, which allows the compiler to use more aggressive optimizations. This improves lua filter performance considerably (⪆5% speedup).
2017-08-13Use hslua >= 0.7, update Lua codeAlbert Krewinkel1-63/+39
2017-06-03Improve code style in lua and org modulesAlbert Krewinkel1-4/+2
2017-05-13Update dates in copyright noticesAlbert Krewinkel1-1/+1
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-04-14Avoid repeating StackValue instances definitionsAlbert Krewinkel1-1/+55
The lua filters and custom lua writer system defined very similar StackValue instances for strings and tuples. These instance definitions are extracted to a separate module to enable sharing.
2017-04-14Extract lua helper functions into Lua.Util moduleAlbert Krewinkel1-0/+86