diff options
-rw-r--r-- | data/pandoc.lua | 6 | ||||
-rw-r--r-- | doc/lua-filters.md | 21 | ||||
-rw-r--r-- | src/Text/Pandoc/Lua/Marshaling/AST.hs | 2 |
3 files changed, 19 insertions, 10 deletions
diff --git a/data/pandoc.lua b/data/pandoc.lua index 340c2f46c..d031bf5d0 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -556,18 +556,18 @@ M.RawBlock = M.Block:create_constructor( --- Creates a table element. -- @function Table --- @tparam Attr attr attributes -- @tparam Caption caption table caption -- @tparam {ColSpec,...} colspecs column alignments and widths -- @tparam TableHead head table head -- @tparam {TableBody,..} bodies table bodies -- @treturn TableFoot foot table foot +-- @tparam[opt] Attr attr attributes M.Table = M.Block:create_constructor( "Table", - function(attr, caption, colspecs, head, bodies, foot) + function(caption, colspecs, head, bodies, foot, attr) return { c = { - attr, + ensureAttr(attr), caption, List:new(colspecs), head, diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 222f40a03..11c54a8fd 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -1104,6 +1104,9 @@ Values of this type can be created with the Fields: +`attr` +: table attributes ([Attr]) + `caption` : table caption ([Caption]) @@ -1120,8 +1123,14 @@ Fields: `foot` : table foot ([TableFoot]) -`attr` -: element attributes ([Attr]) +`identifier` +: alias for `attr.identifier` (string) + +`classes` +: alias for `attr.classes` ([List] of strings) + +`attributes` +: alias for `attr.attributes` ([Attributes]) `tag`, `t` : the literal `Table` (string) @@ -2144,15 +2153,12 @@ format, and functions to filter and modify a subtree. Returns: [RawBlock](#type-rawblock) object -[`Table (attr, caption, colspecs, head, bodies, foot)`]{#pandoc.table} +[`Table (caption, colspecs, head, bodies, foot[, attr])`]{#pandoc.table} : Creates a table element. Parameters: - `attr`: - : element attributes - `caption`: : table [caption](#type-caption) @@ -2168,6 +2174,9 @@ format, and functions to filter and modify a subtree. `foot`: : [table foot](#type-tablefoot) + `attr`: + : element attributes + Returns: [Table](#type-table) object ## Inline diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 359ed6c30..7a75047ae 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -170,7 +170,7 @@ pushBlock = \case Plain blcks -> pushViaConstructor "Plain" blcks RawBlock f cs -> pushViaConstructor "RawBlock" f cs Table attr blkCapt specs thead tbody tfoot -> - pushViaConstructor "Table" attr blkCapt specs thead tbody tfoot + pushViaConstructor "Table" blkCapt specs thead tbody tfoot attr -- | Return the value at the given index as block if possible. peekBlock :: StackIndex -> Lua Block |