Text.Pandoc.Lua.Marshal.Pandoc

pandoc-lua-marshal-0.1.4: Use pandoc types in Lua

Copyright | © 2021 Albert Krewinkel
License | MIT
Maintainer | Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
Safe Haskell | Safe-Inferred
Language | Haskell2010

Text.Pandoc.Lua.Marshal.Pandoc

Contents

- Pandoc
- Meta
- Filtering

Description

Marshaling/unmarshaling functions of `Pandoc` values.

Synopsis

- peekPandoc :: LuaError e => Peeker e Pandoc
- pushPandoc :: LuaError e => Pusher e Pandoc
- mkPandoc :: LuaError e => DocumentedFunction e
- peekMeta :: LuaError e => Peeker e Meta
- pushMeta :: LuaError e => Pusher e Meta
- mkMeta :: LuaError e => DocumentedFunction e
- applyFully :: LuaError e => Filter -> Pandoc -> LuaE e Pandoc

# Pandoc

peekPandoc :: LuaError e => Peeker e Pandoc #

Retrieves a `Pandoc` document from a userdata value.

pushPandoc :: LuaError e => Pusher e Pandoc #

Pushes a `Pandoc` value as userdata.

mkPandoc :: LuaError e => DocumentedFunction e #

Constructor function for `Pandoc` values.

# Meta

peekMeta :: LuaError e => Peeker e Meta #

Retrieves a `Meta` value from a string-indexed table.

pushMeta :: LuaError e => Pusher e Meta #

Pushes a `Meta` value as a string-indexed table.

mkMeta :: LuaError e => DocumentedFunction e #

Constructor for `Meta` values.

# Filtering

applyFully :: LuaError e => Filter -> Pandoc -> LuaE e Pandoc #

Apply all components of a Lua filter.

These operations are run in order:

- Inline filter functions are applied to Inline elements, splicing the result back into the list of Inline elements
- The `Inlines` function is applied to all lists of Inlines.
- Block filter functions are applied to Block elements, splicing the result back into the list of Block elements
- The `Blocks` function is applied to all lists of Blocks.
- The `Meta` function is applied to the `Meta` part.
- The `Pandoc` function is applied to the full `Pandoc` element.