pandoc-2.5: Conversion between markup formats

Copyright | Copyright © 2017–2018 Albert Krewinkel
License | GNU GPL, version 2 or above
Maintainer | Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
Stability | alpha
Safe Haskell | None
Language | Haskell2010

Text.Pandoc.Lua

Contents

- Lua globals
- Filters

Description

Running pandoc Lua filters.

Synopsis

- runLua :: Lua a -> PandocIO (Either LuaException a)
- newtype LuaException = LuaException String
- data Global
  - = FORMAT String
  - | PANDOC_API_VERSION
  - | PANDOC_DOCUMENT Pandoc
  - | PANDOC_READER_OPTIONS ReaderOptions
  - | PANDOC_SCRIPT_FILE FilePath
  - | PANDOC_STATE CommonState
  - | PANDOC_VERSION
- setGlobals :: [Global] -> Lua ()
- runFilterFile :: FilePath -> Pandoc -> Lua Pandoc

# Documentation

runLua :: Lua a -> PandocIO (Either LuaException a) Source #

Run the lua interpreter, using pandoc's default way of environment initialization.

newtype LuaException Source #

Lua error message

Constructors

LuaException String |

Instances

Show LuaException Source # |
Instance details Defined in Text.Pandoc.Lua.Init Methods showsPrec :: Int -> LuaException -> ShowS Source # show :: LuaException -> String Source # showList :: [LuaException] -> ShowS Source #

# Lua globals

data Global Source #

Permissible global Lua variables.

Constructors

FORMAT String |
PANDOC_API_VERSION |
PANDOC_DOCUMENT Pandoc |
PANDOC_READER_OPTIONS ReaderOptions |
PANDOC_SCRIPT_FILE FilePath |
PANDOC_STATE CommonState |
PANDOC_VERSION |

setGlobals :: [Global] -> Lua () Source #

Set all given globals.

# Filters

runFilterFile :: FilePath -> Pandoc -> Lua Pandoc Source #

Transform document using the filter defined in the given file.