-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Use pandoc types in Lua
--   
--   This package provides functions to marshal and unmarshal pandoc
--   document types to and from Lua.
--   
--   The values of most types are pushed to pandoc as "userdata" objects
--   that wrap a stable pointer to the Haskell value; these objects come
--   with methods to access and modify their properties.
--   
--   Sequences are pushed as normal Lua tables, but are augmented with
--   convenience functions.
@package pandoc-lua-marshal
@version 0.3.2.1

-- | Marshaling/unmarshaling functions of Alignment values.
module Text.Pandoc.Lua.Marshal.Alignment

-- | Retrieves a Alignment value from a string.
peekAlignment :: Peeker e Alignment

-- | Pushes a Alignment value as a string.
pushAlignment :: Pusher e Alignment

-- | Marshaling/unmarshaling functions of CitationMode values.
module Text.Pandoc.Lua.Marshal.CitationMode

-- | Retrieves a Citation value from a string.
peekCitationMode :: Peeker e CitationMode

-- | Pushes a CitationMode value as string.
pushCitationMode :: Pusher e CitationMode

-- | Marshaling/unmarshaling functions Lua filters, i.e., tables containing
--   functions to be called on specific elements.
module Text.Pandoc.Lua.Marshal.Filter

-- | Collection of filter functions (at most one function per element
--   constructor)
data Filter
Filter :: WalkingOrder -> Map Name FilterFunction -> Filter
[filterWalkingOrder] :: Filter -> WalkingOrder
[filterMap] :: Filter -> Map Name FilterFunction

-- | Description of how an AST should be traversed.
data WalkingOrder

-- | Process each type separately, traversing the tree bottom-up (leaves to
--   root) for each type.
WalkForEachType :: WalkingOrder

-- | Traverse the tree top-down, from root to leaves and depth first, in a
--   single traversal.
WalkTopdown :: WalkingOrder

-- | Retrieves a default Filter object from the stack, suitable for
--   filtering a full document.
peekFilter :: LuaError e => Peeker e Filter

-- | Looks up a filter function in a Lua Filter.
lookup :: Name -> Filter -> Maybe FilterFunction

-- | Checks whether the Filter contains a function of the given
--   name.
member :: Name -> Filter -> Bool

-- | Filter function stored in the registry
newtype FilterFunction
FilterFunction :: Reference -> FilterFunction

-- | Retrieves a filter function from the stack.
--   
--   The value at the given index must be a function. It is stored in the
--   Lua registry.
peekFilterFunction :: Peeker e FilterFunction

-- | Pushes a filter function to the stack.
--   
--   Filter functions are stored in the registry and retrieved from there.
pushFilterFunction :: LuaError e => FilterFunction -> LuaE e ()

-- | Finds the best filter function for a given element; returns
--   Nothing if no such function exists.
getFunctionFor :: Data a => Filter -> a -> Maybe FilterFunction

-- | The name of a type's base function, which is called if there is no
--   more specific function for a value.
baseFunctionName :: Data a => Proxy a -> Name

-- | The name of the functions that's called on lists of the given type.
listFunctionName :: Data a => Proxy a -> Name

-- | Filter function names for a given type.
valueFunctionNames :: Data a => Proxy a -> [Name]

-- | Marshaling/unmarshaling functions of Format values.
module Text.Pandoc.Lua.Marshal.Format

-- | Retrieves a Format value from a string.
peekFormat :: Peeker e Format

-- | Pushes a Format value as a string.
pushFormat :: Pusher e Format

-- | Lua lists with additional methods.
module Text.Pandoc.Lua.Marshal.List

-- | Pushes a list as a numerically-indexed Lua table, and sets a metatable
--   that offers a number of convenience functions.
pushPandocList :: LuaError e => Pusher e a -> Pusher e [a]

-- | Helpers to make pandoc's Attr elements usable in Lua, and to get
--   objects back into Haskell.
module Text.Pandoc.Lua.Marshal.Attr

-- | Attr object type.
typeAttr :: LuaError e => DocumentedType e Attr

-- | Retrieves an Attr value from a string, a table, or an
--   Attr userdata object. A string is used as an identifier; a
--   table is either an HTML-like set of attributes, or a triple containing
--   the identifier, classes, and attributes.
peekAttr :: LuaError e => Peeker e Attr

-- | Pushes an Attr value as Attr userdata object.
pushAttr :: LuaError e => Pusher e Attr

-- | Constructor functions for AttributeList elements.
typeAttributeList :: LuaError e => DocumentedType e [(Text, Text)]

-- | Pushes an associated list of attributes as AttributeList
--   userdata object.
pushAttributeList :: LuaError e => Pusher e [(Text, Text)]

-- | Retrieves an associated list of attributes from a table or an
--   AttributeList userdata object.
peekAttributeList :: LuaError e => Peeker e [(Text, Text)]

-- | Constructor for Attr.
mkAttr :: LuaError e => DocumentedFunction e

-- | Constructor for AttributeList.
mkAttributeList :: LuaError e => DocumentedFunction e

-- | Marshaling/unmarshaling functions and constructor for
--   ListAttributes values.
module Text.Pandoc.Lua.Marshal.ListAttributes

-- | ListAttributes Lua object type.
typeListAttributes :: LuaError e => DocumentedType e ListAttributes

-- | Retrieve a ListAttributes triple, either from userdata or from
--   a Lua tuple.
peekListAttributes :: LuaError e => Peeker e ListAttributes

-- | Pushes a ListAttributes value as userdata object.
pushListAttributes :: LuaError e => Pusher e ListAttributes

-- | Constructor for a new ListAttributes value.
mkListAttributes :: LuaError e => DocumentedFunction e

-- | Retrieves a ListNumberDelim value from a string.
peekListNumberDelim :: Peeker e ListNumberDelim

-- | Pushes a ListNumberDelim value as string.
pushListNumberDelim :: Pusher e ListNumberDelim

-- | Retrieves a ListNumberStyle value from a string.
peekListNumberStyle :: Peeker e ListNumberStyle

-- | Pushes a ListNumberStyle value as string.
pushListNumberStyle :: Pusher e ListNumberStyle

-- | Marshaling/unmarshaling functions of MathType values.
module Text.Pandoc.Lua.Marshal.MathType

-- | Retrieves a MathType value from a string.
peekMathType :: Peeker e MathType

-- | Pushes a MathType value as a string.
pushMathType :: Pusher e MathType

-- | Marshaling/unmarshaling functions of QuoteType values.
module Text.Pandoc.Lua.Marshal.QuoteType

-- | Retrieves a QuoteType value from a string.
peekQuoteType :: Peeker e QuoteType

-- | Pushes a QuoteType value as a string.
pushQuoteType :: Pusher e QuoteType

-- | Marshaling/unmarshaling functions and constructor for Citation
--   values.
module Text.Pandoc.Lua.Marshal.Citation

-- | Retrieves a Citation value.
peekCitation :: LuaError e => Peeker e Citation

-- | Pushes a Citation value as userdata object.
pushCitation :: LuaError e => Pusher e Citation

-- | Citation object type.
typeCitation :: LuaError e => DocumentedType e Citation

-- | Constructor function for Citation elements.
mkCitation :: LuaError e => DocumentedFunction e

-- | Defines a helper type that can handle different types of Block
--   and Inline element contents.
module Text.Pandoc.Lua.Marshal.Content

-- | Helper type to represent all the different types a content
--   attribute can have.
data Content
ContentBlocks :: [Block] -> Content
ContentInlines :: [Inline] -> Content
ContentLines :: [[Inline]] -> Content
ContentDefItems :: [([Inline], [[Block]])] -> Content
ContentListItems :: [[Block]] -> Content

-- | Returns a human-readable type description; used for error messages.
contentTypeDescription :: Content -> String

-- | Gets a Content element from the stack.
peekContent :: LuaError e => Peeker e Content

-- | Pushes the Content to the stack.
pushContent :: LuaError e => Pusher e Content

-- | Retrieves a single definition item from the stack; it is expected to
--   be a pair of a list of inlines and a list of list of blocks. Uses
--   fuzzy parsing, i.e., tries hard to convert mismatching types into the
--   expected result.
peekDefinitionItem :: LuaError e => Peeker e ([Inline], [[Block]])

-- | Marshal values of types that make up Inline elements.
module Text.Pandoc.Lua.Marshal.Inline

-- | Inline object type.
typeInline :: LuaError e => DocumentedType e Inline

-- | Retrieves an Inline value.
peekInline :: LuaError e => Peeker e Inline

-- | Try extra hard to retrieve an Inline value from the stack. Treats bare
--   strings as Str values.
peekInlineFuzzy :: LuaError e => Peeker e Inline

-- | Pushes an Inline value as userdata object.
pushInline :: LuaError e => Pusher e Inline

-- | Retrieves a list of Inline values.
peekInlines :: LuaError e => Peeker e [Inline]

-- | Try extra-hard to return the value at the given index as a list of
--   inlines.
peekInlinesFuzzy :: LuaError e => Peeker e [Inline]

-- | Pushes a list of Inline values.
pushInlines :: LuaError e => Pusher e [Inline]

-- | Constructor functions for Inline elements.
inlineConstructors :: LuaError e => [DocumentedFunction e]

-- | Constructor for a list of Inline values.
mkInlines :: LuaError e => DocumentedFunction e

-- | Walks an element of type a and applies the filter to all
--   Inline elements. The filter result is spliced back into the
--   list.
walkInlineSplicing :: (LuaError e, Walkable (SpliceList Inline) a) => Filter -> a -> LuaE e a

-- | Walks an element of type a and applies the filter to all
--   lists of Inline elements.
walkInlinesStraight :: (LuaError e, Walkable [Inline] a) => Filter -> a -> LuaE e a

-- | Marshaling/unmarshaling functions of table Cell values.
module Text.Pandoc.Lua.Marshal.Cell

-- | Retrieves a Cell object from the stack.
peekCell :: LuaError e => Peeker e Cell

-- | Retrieves a Cell from the stack, accepting either a 'pandoc
--   Cell' userdata object or a table with fields attr,
--   alignment, row_span, col_span, and
--   contents.
peekCellFuzzy :: LuaError e => Peeker e Cell

-- | Push a table cell as a table with fields attr,
--   alignment, row_span, col_span, and
--   contents.
pushCell :: LuaError e => Cell -> LuaE e ()

-- | Cell object type.
typeCell :: LuaError e => DocumentedType e Cell

-- | Constructor function for Cell values.
mkCell :: LuaError e => DocumentedFunction e

-- | Marshaling/unmarshaling functions of Row values.
module Text.Pandoc.Lua.Marshal.Row

-- | Retrieves a Cell object from the stack.
peekRow :: LuaError e => Peeker e Row

-- | Retrieves a Cell from the stack, accepting either a 'pandoc
--   Cell' userdata object or a table with fields attr,
--   alignment, row_span, col_span, and
--   contents.
peekRowFuzzy :: LuaError e => Peeker e Row

-- | Push a table Row as a table with fields attr,
--   alignment, row_span, col_span, and
--   contents.
pushRow :: LuaError e => Row -> LuaE e ()

-- | Row object type.
typeRow :: LuaError e => DocumentedType e Row

-- | Constructor function for Row values.
mkRow :: LuaError e => DocumentedFunction e

-- | Marshaling/unmarshaling functions of TableHead values.
module Text.Pandoc.Lua.Marshal.TableHead

-- | Retrieves a TableHead from the stack.
peekTableHead :: LuaError e => Peeker e TableHead

-- | Push a TableHead as a userdata value.
pushTableHead :: LuaError e => TableHead -> LuaE e ()

-- | TableHead object type.
typeTableHead :: LuaError e => DocumentedType e TableHead

-- | Constructor function for TableHead values.
mkTableHead :: LuaError e => DocumentedFunction e

-- | Marshaling/unmarshaling functions of TableFoot values.
module Text.Pandoc.Lua.Marshal.TableFoot

-- | Retrieves a TableFoot from the stack.
peekTableFoot :: LuaError e => Peeker e TableFoot

-- | Push a TableFoot as a userdata value.
pushTableFoot :: LuaError e => TableFoot -> LuaE e ()

-- | TableFoot object type.
typeTableFoot :: LuaError e => DocumentedType e TableFoot

-- | Constructor function for TableFoot values.
mkTableFoot :: LuaError e => DocumentedFunction e

-- | Marshaling/unmarshaling functions of TableBody values.
module Text.Pandoc.Lua.Marshal.TableBody

-- | Retrieves a TableBody from the stack.
peekTableBody :: LuaError e => Peeker e TableBody

-- | Retrieves a TableBody from the stack, accepting either a 'pandoc
--   TableBody' userdata object or a table with fields attr,
--   body, head, row_head_columns.
peekTableBodyFuzzy :: LuaError e => Peeker e TableBody

-- | Push a TableBody as a userdata value.
pushTableBody :: LuaError e => TableBody -> LuaE e ()

-- | TableBody object type.
typeTableBody :: LuaError e => DocumentedType e TableBody

-- | Constructor function for TableBody values.
mkTableBody :: LuaError e => DocumentedFunction e

-- | Marshaling/unmarshaling functions of types that are used exclusively
--   with tables.
module Text.Pandoc.Lua.Marshal.TableParts

-- | Peek a ColSpec value as a pair of Alignment and ColWidth.
peekColSpec :: LuaError e => Peeker e ColSpec

-- | Push a ColSpec value as a pair of Alignment and ColWidth.
pushColSpec :: LuaError e => Pusher e ColSpec

-- | Retrieves a Cell object from the stack.
peekRow :: LuaError e => Peeker e Row

-- | Retrieves a Cell from the stack, accepting either a 'pandoc
--   Cell' userdata object or a table with fields attr,
--   alignment, row_span, col_span, and
--   contents.
peekRowFuzzy :: LuaError e => Peeker e Row

-- | Push a table Row as a table with fields attr,
--   alignment, row_span, col_span, and
--   contents.
pushRow :: LuaError e => Row -> LuaE e ()

-- | Retrieves a TableBody from the stack.
peekTableBody :: LuaError e => Peeker e TableBody

-- | Retrieves a TableBody from the stack, accepting either a 'pandoc
--   TableBody' userdata object or a table with fields attr,
--   body, head, row_head_columns.
peekTableBodyFuzzy :: LuaError e => Peeker e TableBody

-- | Push a TableBody as a userdata value.
pushTableBody :: LuaError e => TableBody -> LuaE e ()

-- | Retrieves a TableFoot from the stack.
peekTableFoot :: LuaError e => Peeker e TableFoot

-- | Push a TableFoot as a userdata value.
pushTableFoot :: LuaError e => TableFoot -> LuaE e ()

-- | Retrieves a TableHead from the stack.
peekTableHead :: LuaError e => Peeker e TableHead

-- | Push a TableHead as a userdata value.
pushTableHead :: LuaError e => TableHead -> LuaE e ()

-- | Constructor function for Row values.
mkRow :: LuaError e => DocumentedFunction e

-- | Constructor function for TableBody values.
mkTableBody :: LuaError e => DocumentedFunction e

-- | Constructor function for TableFoot values.
mkTableFoot :: LuaError e => DocumentedFunction e

-- | Constructor function for TableHead values.
mkTableHead :: LuaError e => DocumentedFunction e

-- | Marshaling and unmarshaling of Caption elements.
module Text.Pandoc.Lua.Marshal.Caption

-- | Peek Caption element from userdata.
peekCaption :: LuaError e => Peeker e Caption
peekCaptionFuzzy :: LuaError e => Peeker e Caption

-- | Push Caption element
pushCaption :: LuaError e => Pusher e Caption

-- | Constructor for Caption.
mkCaption :: LuaError e => DocumentedFunction e

-- | Marshal values of types that make up Block elements.
module Text.Pandoc.Lua.Marshal.Block

-- | Block object type.
typeBlock :: LuaError e => DocumentedType e Block

-- | Retrieves an Block value.
peekBlock :: LuaError e => Peeker e Block

-- | Try extra hard to retrieve a Block value from the stack. Treats bare
--   strings as Str values.
peekBlockFuzzy :: LuaError e => Peeker e Block

-- | Pushes an Block value as userdata object.
pushBlock :: LuaError e => Pusher e Block

-- | Retrieves a list of Block values.
peekBlocks :: LuaError e => Peeker e [Block]

-- | Try extra-hard to return the value at the given index as a list of
--   Blocks.
peekBlocksFuzzy :: LuaError e => Peeker e [Block]

-- | Pushes a list of Block values.
pushBlocks :: LuaError e => Pusher e [Block]

-- | Constructor functions for Block elements.
blockConstructors :: LuaError e => [DocumentedFunction e]

-- | Constructor for a list of Block values.
mkBlocks :: LuaError e => DocumentedFunction e
walkBlockSplicing :: (LuaError e, Walkable (SpliceList Block) a) => Filter -> a -> LuaE e a
walkBlocksStraight :: (LuaError e, Walkable [Block] a) => Filter -> a -> LuaE e a

-- | Definition and marshaling of the SimpleTable data type used as
--   a convenience type when dealing with tables.
module Text.Pandoc.Lua.Marshal.SimpleTable

-- | A simple (legacy-style) table.
data SimpleTable
SimpleTable :: [Inline] -> [Alignment] -> [Double] -> [[Block]] -> [[[Block]]] -> SimpleTable
[simpleTableCaption] :: SimpleTable -> [Inline]
[simpleTableAlignments] :: SimpleTable -> [Alignment]
[simpleTableColumnWidths] :: SimpleTable -> [Double]
[simpleTableHeader] :: SimpleTable -> [[Block]]
[simpleTableBody] :: SimpleTable -> [[[Block]]]

-- | Retrieve a simple table from the stack.
peekSimpleTable :: LuaError e => Peeker e SimpleTable

-- | Push a simple table to the stack by calling the
--   pandoc.SimpleTable constructor.
pushSimpleTable :: LuaError e => SimpleTable -> LuaE e ()

-- | Constructor for the SimpleTable type.
mkSimpleTable :: LuaError e => DocumentedFunction e
instance GHC.Classes.Eq Text.Pandoc.Lua.Marshal.SimpleTable.SimpleTable
instance GHC.Internal.Show.Show Text.Pandoc.Lua.Marshal.SimpleTable.SimpleTable

-- | Marshaling/unmarshaling functions of MetaValue elements.
module Text.Pandoc.Lua.Marshal.MetaValue

-- | Retrieves the value at the given stack index as MetaValue.
peekMetaValue :: LuaError e => Peeker e MetaValue

-- | Push a MetaValue element to the top of the Lua stack.
pushMetaValue :: LuaError e => Pusher e MetaValue

-- | Constructor functions for MetaValue elements.
metaValueConstructors :: LuaError e => [DocumentedFunction e]

-- | Marshaling/unmarshaling functions of Pandoc values.
module Text.Pandoc.Lua.Marshal.Pandoc

-- | Pandoc object type.
typePandoc :: LuaError e => DocumentedType e Pandoc

-- | Retrieves a Pandoc document from a userdata value.
peekPandoc :: LuaError e => Peeker e Pandoc

-- | Pushes a Pandoc value as userdata.
pushPandoc :: LuaError e => Pusher e Pandoc

-- | Constructor function for Pandoc values.
mkPandoc :: LuaError e => DocumentedFunction e

-- | Retrieves a Meta value from a string-indexed table.
peekMeta :: LuaError e => Peeker e Meta

-- | Pushes a Meta value as a string-indexed table.
pushMeta :: LuaError e => Pusher e Meta

-- | Constructor for Meta values.
mkMeta :: LuaError e => DocumentedFunction e

-- | 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.
--   
applyFully :: LuaError e => Filter -> Pandoc -> LuaE e Pandoc

-- | Use pandoc types in Lua
module Text.Pandoc.Lua.Marshal.AST
