{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}
module Text.Pandoc.Lua.Marshal.Cell
( peekCell
, peekCellFuzzy
, pushCell
, typeCell
, mkCell
) where
import Control.Applicative (optional)
import Control.Monad ((<$!>))
import Data.Aeson (encode)
import Data.Maybe (fromMaybe)
import HsLua
import Text.Pandoc.Lua.Marshal.Alignment (peekAlignment, pushAlignment)
import Text.Pandoc.Lua.Marshal.Attr (peekAttr, pushAttr)
import {-# SOURCE #-} Text.Pandoc.Lua.Marshal.Block
( peekBlocksFuzzy, pushBlocks )
import Text.Pandoc.Lua.Marshal.Filter (peekFilter)
import Text.Pandoc.Lua.Marshal.Shared (walkBlocksAndInlines)
import Text.Pandoc.Definition
pushCell :: LuaError e => Cell -> LuaE e ()
pushCell :: forall e. LuaError e => Cell -> LuaE e ()
pushCell = DocumentedTypeWithList e Cell Void -> Cell -> LuaE e ()
forall e a itemtype.
LuaError e =>
DocumentedTypeWithList e a itemtype -> a -> LuaE e ()
pushUD DocumentedTypeWithList e Cell Void
forall e. LuaError e => DocumentedType e Cell
typeCell
peekCell :: LuaError e => Peeker e Cell
peekCell :: forall e. LuaError e => Peeker e Cell
peekCell = DocumentedTypeWithList e Cell Void -> Peeker e Cell
forall e a itemtype.
LuaError e =>
DocumentedTypeWithList e a itemtype -> Peeker e a
peekUD DocumentedTypeWithList e Cell Void
forall e. LuaError e => DocumentedType e Cell
typeCell
peekCellFuzzy :: LuaError e => Peeker e Cell
peekCellFuzzy :: forall e. LuaError e => Peeker e Cell
peekCellFuzzy StackIndex
idx = LuaE e Type -> Peek e Type
forall e a. LuaE e a -> Peek e a
liftLua (StackIndex -> LuaE e Type
forall e. StackIndex -> LuaE e Type
ltype StackIndex
idx) Peek e Type -> (Type -> Peek e Cell) -> Peek e Cell
forall a b. Peek e a -> (a -> Peek e b) -> Peek e b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \case
Type
TypeUserdata -> Peeker e Cell
forall e. LuaError e => Peeker e Cell
peekCell StackIndex
idx
Type
TypeTable -> do
Attr
attr <- Peeker e Attr -> Name -> Peeker e Attr
forall e a. LuaError e => Peeker e a -> Name -> Peeker e a
peekFieldRaw Peeker e Attr
forall e. LuaError e => Peeker e Attr
peekAttr Name
"attr" StackIndex
idx
Alignment
algn <- Peeker e Alignment -> Name -> Peeker e Alignment
forall e a. LuaError e => Peeker e a -> Name -> Peeker e a
peekFieldRaw Peeker e Alignment
forall e. Peeker e Alignment
peekAlignment Name
"alignment" StackIndex
idx
RowSpan
rs <- Int -> RowSpan
RowSpan (Int -> RowSpan) -> Peek e Int -> Peek e RowSpan
forall (m :: * -> *) a b. Monad m => (a -> b) -> m a -> m b
<$!> Peeker e Int -> Name -> Peeker e Int
forall e a. LuaError e => Peeker e a -> Name -> Peeker e a
peekFieldRaw Peeker e Int
forall a e. (Integral a, Read a) => Peeker e a
peekIntegral Name
"row_span" StackIndex
idx
ColSpan
cs <- Int -> ColSpan
ColSpan (Int -> ColSpan) -> Peek e Int -> Peek e ColSpan
forall (m :: * -> *) a b. Monad m => (a -> b) -> m a -> m b
<$!> Peeker e Int -> Name -> Peeker e Int
forall e a. LuaError e => Peeker e a -> Name -> Peeker e a
peekFieldRaw Peeker e Int
forall a e. (Integral a, Read a) => Peeker e a
peekIntegral Name
"col_span" StackIndex
idx
[Block]
blks <- Peeker e [Block] -> Name -> Peeker e [Block]
forall e a. LuaError e => Peeker e a -> Name -> Peeker e a
peekFieldRaw Peeker e [Block]
forall e. LuaError e => Peeker e [Block]
peekBlocksFuzzy Name
"contents" StackIndex
idx
Cell -> Peek e Cell
forall a. a -> Peek e a
forall (m :: * -> *) a. Monad m => a -> m a
return (Cell -> Peek e Cell) -> Cell -> Peek e Cell
forall a b. (a -> b) -> a -> b
$! Attr -> Alignment -> RowSpan -> ColSpan -> [Block] -> Cell
Cell Attr
attr Alignment
algn RowSpan
rs ColSpan
cs [Block]
blks
Type
_ -> ByteString -> Peek e Cell
forall a e. ByteString -> Peek e a
failPeek (ByteString -> Peek e Cell) -> Peek e ByteString -> Peek e Cell
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Name -> StackIndex -> Peek e ByteString
forall e. Name -> StackIndex -> Peek e ByteString
typeMismatchMessage Name
"Cell or table" StackIndex
idx
typeCell :: LuaError e => DocumentedType e Cell
typeCell :: forall e. LuaError e => DocumentedType e Cell
typeCell = Name
-> [(Operation, DocumentedFunction e)]
-> [Member e (DocumentedFunction e) Cell]
-> DocumentedType e Cell
forall e a.
LuaError e =>
Name
-> [(Operation, DocumentedFunction e)]
-> [Member e (DocumentedFunction e) a]
-> DocumentedType e a
deftype Name
"pandoc Cell"
[ Operation
-> DocumentedFunction e -> (Operation, DocumentedFunction e)
forall e.
Operation
-> DocumentedFunction e -> (Operation, DocumentedFunction e)
operation Operation
Eq (DocumentedFunction e -> (Operation, DocumentedFunction e))
-> DocumentedFunction e -> (Operation, DocumentedFunction e)
forall a b. (a -> b) -> a -> b
$ Name
-> (Maybe Cell -> Maybe Cell -> LuaE e Bool)
-> HsFnPrecursor e (Maybe Cell -> Maybe Cell -> LuaE e Bool)
forall a e. Name -> a -> HsFnPrecursor e a
defun Name
"__eq"
### liftPure2 (\a b -> fromMaybe False ((==) <$> a <*> b))
HsFnPrecursor e (Maybe Cell -> Maybe Cell -> LuaE e Bool)
-> Parameter e (Maybe Cell)
-> HsFnPrecursor e (Maybe Cell -> LuaE e Bool)
forall e a b.
HsFnPrecursor e (a -> b) -> Parameter e a -> HsFnPrecursor e b
<#> Peeker e (Maybe Cell)
-> TypeSpec -> Text -> Text -> Parameter e (Maybe Cell)
forall e a. Peeker e a -> TypeSpec -> Text -> Text -> Parameter e a
parameter (Peek e Cell -> Peek e (Maybe Cell)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (Peek e Cell -> Peek e (Maybe Cell))
-> (StackIndex -> Peek e Cell) -> Peeker e (Maybe Cell)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StackIndex -> Peek e Cell
forall e. LuaError e => Peeker e Cell
peekCell) TypeSpec
"Cell" Text
"self" Text
""
HsFnPrecursor e (Maybe Cell -> LuaE e Bool)
-> Parameter e (Maybe Cell) -> HsFnPrecursor e (LuaE e Bool)
forall e a b.
HsFnPrecursor e (a -> b) -> Parameter e a -> HsFnPrecursor e b
<#> Peeker e (Maybe Cell)
-> TypeSpec -> Text -> Text -> Parameter e (Maybe Cell)
forall e a. Peeker e a -> TypeSpec -> Text -> Text -> Parameter e a
parameter (Peek e Cell -> Peek e (Maybe Cell)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (Peek e Cell -> Peek e (Maybe Cell))
-> (StackIndex -> Peek e Cell) -> Peeker e (Maybe Cell)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StackIndex -> Peek e Cell
forall e. LuaError e => Peeker e Cell
peekCell) TypeSpec
"any" Text
"object" Text
""
HsFnPrecursor e (LuaE e Bool)
-> FunctionResults e Bool -> DocumentedFunction e
forall e a.
HsFnPrecursor e (LuaE e a)
-> FunctionResults e a -> DocumentedFunction e
=#> Pusher e Bool -> TypeSpec -> Text -> FunctionResults e Bool
forall e a. Pusher e a -> TypeSpec -> Text -> FunctionResults e a
functionResult Pusher e Bool
forall e. Pusher e Bool
pushBool TypeSpec
"boolean" Text
"true iff the two values are equal"
, Operation
-> DocumentedFunction e -> (Operation, DocumentedFunction e)
forall e.
Operation
-> DocumentedFunction e -> (Operation, DocumentedFunction e)
operation Operation
Tostring (DocumentedFunction e -> (Operation, DocumentedFunction e))
-> DocumentedFunction e -> (Operation, DocumentedFunction e)
forall a b. (a -> b) -> a -> b
$ (Cell -> LuaE e String) -> HsFnPrecursor e (Cell -> LuaE e String)
forall a e. a -> HsFnPrecursor e a
lambda
### liftPure show
HsFnPrecursor e (Cell -> LuaE e String)
-> Parameter e Cell -> HsFnPrecursor e (LuaE e String)
forall e a b.
HsFnPrecursor e (a -> b) -> Parameter e a -> HsFnPrecursor e b
<#> (StackIndex -> Peek e Cell)
-> TypeSpec -> Text -> Text -> Parameter e Cell
forall e a. Peeker e a -> TypeSpec -> Text -> Text -> Parameter e a
parameter StackIndex -> Peek e Cell
forall e. LuaError e => Peeker e Cell
peekCell TypeSpec
"Cell" Text
"self" Text
""
HsFnPrecursor e (LuaE e String)
-> FunctionResults e String -> DocumentedFunction e
forall e a.
HsFnPrecursor e (LuaE e a)
-> FunctionResults e a -> DocumentedFunction e
=#> Pusher e String -> TypeSpec -> Text -> FunctionResults e String
forall e a. Pusher e a -> TypeSpec -> Text -> FunctionResults e a
functionResult Pusher e String
forall e. String -> LuaE e ()
pushString TypeSpec
"string" Text
"native Haskell representation"
, Operation
-> DocumentedFunction e -> (Operation, DocumentedFunction e)
forall e.
Operation
-> DocumentedFunction e -> (Operation, DocumentedFunction e)
operation (Name -> Operation
CustomOperation Name
"__tojson") (DocumentedFunction e -> (Operation, DocumentedFunction e))
-> DocumentedFunction e -> (Operation, DocumentedFunction e)
forall a b. (a -> b) -> a -> b
$ (Cell -> LuaE e ByteString)
-> HsFnPrecursor e (Cell -> LuaE e ByteString)
forall a e. a -> HsFnPrecursor e a
lambda
### liftPure encode
HsFnPrecursor e (Cell -> LuaE e ByteString)
-> Parameter e Cell -> HsFnPrecursor e (LuaE e ByteString)
forall e a b.
HsFnPrecursor e (a -> b) -> Parameter e a -> HsFnPrecursor e b
<#> DocumentedType e Cell -> Text -> Text -> Parameter e Cell
forall e a itemtype.
LuaError e =>
DocumentedTypeWithList e a itemtype
-> Text -> Text -> Parameter e a
udparam DocumentedType e Cell
forall e. LuaError e => DocumentedType e Cell
typeCell Text
"self" Text
""
HsFnPrecursor e (LuaE e ByteString)
-> FunctionResults e ByteString -> DocumentedFunction e
forall e a.
HsFnPrecursor e (LuaE e a)
-> FunctionResults e a -> DocumentedFunction e
=#> Pusher e ByteString
-> TypeSpec -> Text -> FunctionResults e ByteString
forall e a. Pusher e a -> TypeSpec -> Text -> FunctionResults e a
functionResult Pusher e ByteString
forall e. Pusher e ByteString
pushLazyByteString TypeSpec
"string" Text
"JSON representation"
]
[ Name
-> Text
-> (Pusher e Attr, Cell -> Attr)
-> (Peeker e Attr, Cell -> Attr -> Cell)
-> Member e (DocumentedFunction e) Cell
forall e b a fn.
LuaError e =>
Name
-> Text
-> (Pusher e b, a -> b)
-> (Peeker e b, a -> b -> a)
-> Member e fn a
property Name
"attr" Text
"cell attributes"
(Pusher e Attr
forall e. LuaError e => Pusher e Attr
pushAttr, \(Cell Attr
attr Alignment
_ RowSpan
_ ColSpan
_ [Block]
_) -> Attr
attr)
(Peeker e Attr
forall e. LuaError e => Peeker e Attr
peekAttr, \(Cell Attr
_ Alignment
align RowSpan
rs ColSpan
cs [Block]
blks) Attr
attr ->
Attr -> Alignment -> RowSpan -> ColSpan -> [Block] -> Cell
Cell Attr
attr Alignment
align RowSpan
rs ColSpan
cs [Block]
blks)
, Name
-> Text
-> (Pusher e Alignment, Cell -> Alignment)
-> (Peeker e Alignment, Cell -> Alignment -> Cell)
-> Member e (DocumentedFunction e) Cell
forall e b a fn.
LuaError e =>
Name
-> Text
-> (Pusher e b, a -> b)
-> (Peeker e b, a -> b -> a)
-> Member e fn a
property Name
"alignment" Text
"alignment of cell contents"
(Pusher e Alignment
forall e. Pusher e Alignment
pushAlignment, \(Cell Attr
_ Alignment
align RowSpan
_ ColSpan
_ [Block]
_) -> Alignment
align)
(Peeker e Alignment
forall e. Peeker e Alignment
peekAlignment, \(Cell Attr
attr Alignment
_ RowSpan
rs ColSpan
cs [Block]
blks) Alignment
align ->
Attr -> Alignment -> RowSpan -> ColSpan -> [Block] -> Cell
Cell Attr
attr Alignment
align RowSpan
rs ColSpan
cs [Block]
blks)
, Name
-> Text
-> (Pusher e Int, Cell -> Int)
-> (Peeker e Int, Cell -> Int -> Cell)
-> Member e (DocumentedFunction e) Cell
forall e b a fn.
LuaError e =>
Name
-> Text
-> (Pusher e b, a -> b)
-> (Peeker e b, a -> b -> a)
-> Member e fn a
property Name
"row_span" Text
"number of rows over which this cell spans"
(Pusher e Int
forall a e. (Integral a, Show a) => a -> LuaE e ()
pushIntegral, \(Cell Attr
_ Alignment
_ (RowSpan Int
rs) ColSpan
_ [Block]
_) -> Int
rs)
(Peeker e Int
forall a e. (Integral a, Read a) => Peeker e a
peekIntegral, \(Cell Attr
attr Alignment
align RowSpan
_ ColSpan
cs [Block]
blks) Int
rs ->
Attr -> Alignment -> RowSpan -> ColSpan -> [Block] -> Cell
Cell Attr
attr Alignment
align (Int -> RowSpan
RowSpan Int
rs) ColSpan
cs [Block]
blks)
, Name
-> Text
-> (Pusher e Int, Cell -> Int)
-> (Peeker e Int, Cell -> Int -> Cell)
-> Member e (DocumentedFunction e) Cell
forall e b a fn.
LuaError e =>
Name
-> Text
-> (Pusher e b, a -> b)
-> (Peeker e b, a -> b -> a)
-> Member e fn a
property Name
"col_span" Text
"number of columns over which this cell spans"
(Pusher e Int
forall a e. (Integral a, Show a) => a -> LuaE e ()
pushIntegral, \(Cell Attr
_ Alignment
_ RowSpan
_ (ColSpan Int
rs) [Block]
_) -> Int
rs)
(Peeker e Int
forall a e. (Integral a, Read a) => Peeker e a
peekIntegral, \(Cell Attr
attr Alignment
align RowSpan
rs ColSpan
_ [Block]
blks) Int
cs ->
Attr -> Alignment -> RowSpan -> ColSpan -> [Block] -> Cell
Cell Attr
attr Alignment
align RowSpan
rs (Int -> ColSpan
ColSpan Int
cs) [Block]
blks)
, Name
-> Text
-> (Pusher e [Block], Cell -> [Block])
-> (Peeker e [Block], Cell -> [Block] -> Cell)
-> Member e (DocumentedFunction e) Cell
forall e b a fn.
LuaError e =>
Name
-> Text
-> (Pusher e b, a -> b)
-> (Peeker e b, a -> b -> a)
-> Member e fn a
property Name
"contents" Text
"cell contents"
(Pusher e [Block]
forall e. LuaError e => Pusher e [Block]
pushBlocks, \(Cell Attr
_ Alignment
_ RowSpan
_ ColSpan
_ [Block]
blks) -> [Block]
blks)
(Peeker e [Block]
forall e. LuaError e => Peeker e [Block]
peekBlocksFuzzy, \(Cell Attr
attr Alignment
align RowSpan
rs ColSpan
cs [Block]
_) [Block]
blks ->
Attr -> Alignment -> RowSpan -> ColSpan -> [Block] -> Cell
Cell Attr
attr Alignment
align RowSpan
rs ColSpan
cs [Block]
blks)
, AliasIndex
-> Text -> [AliasIndex] -> Member e (DocumentedFunction e) Cell
forall e fn a. AliasIndex -> Text -> [AliasIndex] -> Member e fn a
alias AliasIndex
"content" Text
"alias for contents" [AliasIndex
"contents"]
, AliasIndex
-> Text -> [AliasIndex] -> Member e (DocumentedFunction e) Cell
forall e fn a. AliasIndex -> Text -> [AliasIndex] -> Member e fn a
alias AliasIndex
"identifier" Text
"cell ID" [AliasIndex
"attr", AliasIndex
"identifier"]
, AliasIndex
-> Text -> [AliasIndex] -> Member e (DocumentedFunction e) Cell
forall e fn a. AliasIndex -> Text -> [AliasIndex] -> Member e fn a
alias AliasIndex
"classes" Text
"cell classes" [AliasIndex
"attr", AliasIndex
"classes"]
, AliasIndex
-> Text -> [AliasIndex] -> Member e (DocumentedFunction e) Cell
forall e fn a. AliasIndex -> Text -> [AliasIndex] -> Member e fn a
alias AliasIndex
"attributes" Text
"cell attributes" [AliasIndex
"attr", AliasIndex
"attributes"]
, DocumentedFunction e -> Member e (DocumentedFunction e) Cell
forall e a.
DocumentedFunction e -> Member e (DocumentedFunction e) a
method (DocumentedFunction e -> Member e (DocumentedFunction e) Cell)
-> DocumentedFunction e -> Member e (DocumentedFunction e) Cell
forall a b. (a -> b) -> a -> b
$ Name
-> (Cell -> Filter -> LuaE e Cell)
-> HsFnPrecursor e (Cell -> Filter -> LuaE e Cell)
forall a e. Name -> a -> HsFnPrecursor e a
defun Name
"walk"
### flip walkBlocksAndInlines
HsFnPrecursor e (Cell -> Filter -> LuaE e Cell)
-> Parameter e Cell -> HsFnPrecursor e (Filter -> LuaE e Cell)
forall e a b.
HsFnPrecursor e (a -> b) -> Parameter e a -> HsFnPrecursor e b
<#> (StackIndex -> Peek e Cell)
-> TypeSpec -> Text -> Text -> Parameter e Cell
forall e a. Peeker e a -> TypeSpec -> Text -> Text -> Parameter e a
parameter StackIndex -> Peek e Cell
forall e. LuaError e => Peeker e Cell
peekCell TypeSpec
"Cell" Text
"self" Text
""
HsFnPrecursor e (Filter -> LuaE e Cell)
-> Parameter e Filter -> HsFnPrecursor e (LuaE e Cell)
forall e a b.
HsFnPrecursor e (a -> b) -> Parameter e a -> HsFnPrecursor e b
<#> Peeker e Filter -> TypeSpec -> Text -> Text -> Parameter e Filter
forall e a. Peeker e a -> TypeSpec -> Text -> Text -> Parameter e a
parameter Peeker e Filter
forall e. LuaError e => Peeker e Filter
peekFilter TypeSpec
"Filter" Text
"lua_filter" Text
"table of filter functions"
HsFnPrecursor e (LuaE e Cell)
-> FunctionResults e Cell -> DocumentedFunction e
forall e a.
HsFnPrecursor e (LuaE e a)
-> FunctionResults e a -> DocumentedFunction e
=#> Pusher e Cell -> TypeSpec -> Text -> FunctionResults e Cell
forall e a. Pusher e a -> TypeSpec -> Text -> FunctionResults e a
functionResult Pusher e Cell
forall e. LuaError e => Cell -> LuaE e ()
pushCell TypeSpec
"Cell" Text
"modified cell"
]
mkCell :: LuaError e => DocumentedFunction e
mkCell :: forall e. LuaError e => DocumentedFunction e
mkCell = Name
-> ([Block]
-> Maybe Alignment
-> Maybe Int
-> Maybe Int
-> Maybe Attr
-> LuaE e Cell)
-> HsFnPrecursor
e
([Block]
-> Maybe Alignment
-> Maybe Int
-> Maybe Int
-> Maybe Attr
-> LuaE e Cell)
forall a e. Name -> a -> HsFnPrecursor e a
defun Name
"Cell"
### liftPure5 (\blocks mAlign mRowSpan mColSpan mAttr -> Cell
(fromMaybe nullAttr mAttr)
(fromMaybe AlignDefault mAlign)
(maybe 1 RowSpan mRowSpan)
(maybe 1 ColSpan mColSpan)
blocks)
HsFnPrecursor
e
([Block]
-> Maybe Alignment
-> Maybe Int
-> Maybe Int
-> Maybe Attr
-> LuaE e Cell)
-> Parameter e [Block]
-> HsFnPrecursor
e
(Maybe Alignment
-> Maybe Int -> Maybe Int -> Maybe Attr -> LuaE e Cell)
forall e a b.
HsFnPrecursor e (a -> b) -> Parameter e a -> HsFnPrecursor e b
<#> Peeker e [Block] -> TypeSpec -> Text -> Text -> Parameter e [Block]
forall e a. Peeker e a -> TypeSpec -> Text -> Text -> Parameter e a
parameter Peeker e [Block]
forall e. LuaError e => Peeker e [Block]
peekBlocksFuzzy TypeSpec
"Blocks" Text
"blocks" Text
"cell contents"
HsFnPrecursor
e
(Maybe Alignment
-> Maybe Int -> Maybe Int -> Maybe Attr -> LuaE e Cell)
-> Parameter e (Maybe Alignment)
-> HsFnPrecursor
e (Maybe Int -> Maybe Int -> Maybe Attr -> LuaE e Cell)
forall e a b.
HsFnPrecursor e (a -> b) -> Parameter e a -> HsFnPrecursor e b
<#> Parameter e Alignment -> Parameter e (Maybe Alignment)
forall e a. Parameter e a -> Parameter e (Maybe a)
opt (Peeker e Alignment
-> TypeSpec -> Text -> Text -> Parameter e Alignment
forall e a. Peeker e a -> TypeSpec -> Text -> Text -> Parameter e a
parameter Peeker e Alignment
forall e. Peeker e Alignment
peekAlignment TypeSpec
"Alignment" Text
"align"
Text
"text alignment; defaults to `AlignDefault`")
HsFnPrecursor
e (Maybe Int -> Maybe Int -> Maybe Attr -> LuaE e Cell)
-> Parameter e (Maybe Int)
-> HsFnPrecursor e (Maybe Int -> Maybe Attr -> LuaE e Cell)
forall e a b.
HsFnPrecursor e (a -> b) -> Parameter e a -> HsFnPrecursor e b
<#> Parameter e Int -> Parameter e (Maybe Int)
forall e a. Parameter e a -> Parameter e (Maybe a)
opt (Peeker e Int -> TypeSpec -> Text -> Text -> Parameter e Int
forall e a. Peeker e a -> TypeSpec -> Text -> Text -> Parameter e a
parameter Peeker e Int
forall a e. (Integral a, Read a) => Peeker e a
peekIntegral TypeSpec
"integer" Text
"rowspan"
Text
"number of rows occupied by the cell; defaults to `1`")
HsFnPrecursor e (Maybe Int -> Maybe Attr -> LuaE e Cell)
-> Parameter e (Maybe Int)
-> HsFnPrecursor e (Maybe Attr -> LuaE e Cell)
forall e a b.
HsFnPrecursor e (a -> b) -> Parameter e a -> HsFnPrecursor e b
<#> Parameter e Int -> Parameter e (Maybe Int)
forall e a. Parameter e a -> Parameter e (Maybe a)
opt (Peeker e Int -> TypeSpec -> Text -> Text -> Parameter e Int
forall e a. Peeker e a -> TypeSpec -> Text -> Text -> Parameter e a
parameter Peeker e Int
forall a e. (Integral a, Read a) => Peeker e a
peekIntegral TypeSpec
"integer" Text
"colspan"
Text
"number of columns occupied by the cell; defaults to `1`")
HsFnPrecursor e (Maybe Attr -> LuaE e Cell)
-> Parameter e (Maybe Attr) -> HsFnPrecursor e (LuaE e Cell)
forall e a b.
HsFnPrecursor e (a -> b) -> Parameter e a -> HsFnPrecursor e b
<#> Parameter e Attr -> Parameter e (Maybe Attr)
forall e a. Parameter e a -> Parameter e (Maybe a)
opt (Peeker e Attr -> TypeSpec -> Text -> Text -> Parameter e Attr
forall e a. Peeker e a -> TypeSpec -> Text -> Text -> Parameter e a
parameter Peeker e Attr
forall e. LuaError e => Peeker e Attr
peekAttr TypeSpec
"Attr" Text
"attr" Text
"cell attributes")
HsFnPrecursor e (LuaE e Cell)
-> FunctionResults e Cell -> DocumentedFunction e
forall e a.
HsFnPrecursor e (LuaE e a)
-> FunctionResults e a -> DocumentedFunction e
=#> Pusher e Cell -> TypeSpec -> Text -> FunctionResults e Cell
forall e a. Pusher e a -> TypeSpec -> Text -> FunctionResults e a
functionResult Pusher e Cell
forall e. LuaError e => Cell -> LuaE e ()
pushCell TypeSpec
"Cell" Text
"new Cell object"
#? "Create a new table cell."