aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Lua/Init.hs
AgeCommit message (Collapse)AuthorFilesLines
2018-10-28T.P.Lua: expose more useful internals (API change)Albert Krewinkel1-2/+1
Newly exported from Text.Pandoc.Lua: - `runFilterFile` to run a Lua filter from file; - data type `Global` and its constructors; and - `setGlobals` to add globals to a Lua environment. This module also contains `Pushable` and `Peekable` instances required to get pandoc's data types to and from Lua. Low-level Lua operation remain hidden in Text.Pandoc.Lua.
2018-10-28T.P.Lua: rename `runPandocLua` to `runLua` (API change)Albert Krewinkel1-3/+3
2018-10-26Text.Pandoc.Lua: move globals handling to separate moduleAlbert Krewinkel1-21/+18
2018-10-25Lua: allow access to pandoc state (#5015)Albert Krewinkel1-5/+10
* Lua: allow access to pandoc state Lua filters and custom writers now have read-only access to most fields of pandoc's internal state via the global variable `PANDOC_STATE`. * Lua: allow iterating through fields of PANDOC_STATE * Lua filters doc: describe CommonState * Lua filters doc: mention global variable PANDOC_STATE * Lua: add access to logs Log messages can currently only be printed, but not decomposed.
2018-10-12Lua filters: push ListAttributes via constructorAlbert Krewinkel1-0/+1
This ensures that ListAttributes, as present in OrderedList elements, have additional accessors (viz. *start*, *style*, and *delimiter*).
2018-09-24Use hslua v1.0.0Albert Krewinkel1-4/+9
2018-07-02Spellcheck commentsAlexander Krotov1-1/+1
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-02-24Lua: register script name in global variableAlbert Krewinkel1-1/+7
The name of the Lua script which is executed is made available in the global Lua variable `PANDOC_SCRIPT_FILE`, both for Lua filters and custom writers. Closes: #4393
2018-01-23Lua filters: store constructors in registryAlbert Krewinkel1-0/+25
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-07Lua: make pandoc-types version available as PANDOC_API_VERSIONAlbert Krewinkel1-0/+3
The current pandoc-types version is made available to Lua programs in the global PANDOC_API_VERSION. It contains the version as a list of numbers.
2018-01-07Lua: make pandoc version available as PANDOC_VERSIONAlbert Krewinkel1-0/+4
The current pandoc version is made available to Lua programs in the global PANDOC_VERSION. It contains the version as a list of numbers.
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
2017-12-18Lua filters: perform minor code clean-upAlbert Krewinkel1-4/+4
Change: minor
2017-12-13Custom writer: use init file to setup Lua interpreterAlbert Krewinkel1-0/+79
The same init file (`data/init`) that is used to setup the Lua interpreter for Lua filters is also used to setup the interpreter of custom writers.lua.