aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2020-01-10 20:13:06 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2020-01-11 19:38:27 +0100
commite98921ae571717d3d7c1fbaf7d7d527361b664c9 (patch)
treeae6886402a129baa0b69e4ce6d461486a760ffda /doc
parent57637f8aae6172e7713e885f41f4574cfa2770b3 (diff)
downloadpandoc-e98921ae571717d3d7c1fbaf7d7d527361b664c9.tar.gz
pandoc.List.lua: make `pandoc.List` a callable constructor
It is now possible to construct a new List via `pandoc.List()` instead of `pandoc.List:new()`.
Diffstat (limited to 'doc')
-rw-r--r--doc/lua-filters.md24
1 files changed, 23 insertions, 1 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md
index 7d084ecb4..ae7b02c76 100644
--- a/doc/lua-filters.md
+++ b/doc/lua-filters.md
@@ -2662,7 +2662,16 @@ Usage:
# Module pandoc.List
-Pandoc\'s List type and helper methods
+The this module defines pandoc's list type. It comes with useful
+methods and convenience functions.
+
+## Constructor
+
+[`pandoc.List([table])`]{#pandoc.List}
+
+: Create a new List. If the optional argument `table` is given,
+ set the metatable of that value to `pandoc.List`. This is an
+ alias for [`pandoc.List:new([table])`](#pandoc.list:new).
## Metamethods
@@ -2684,6 +2693,19 @@ Pandoc\'s List type and helper methods
: Returns a (shallow) copy of the list.
+[`pandoc.List:new([table])`]{#pandoc.List:new}
+
+: Create a new List. If the optional argument `table` is given,
+ set the metatable of that value to `pandoc.List`.
+
+ Parameters:
+
+ `table`:
+ : table which should be treatable as a list; defaults to an
+ empty table
+
+ Returns: the updated input value
+
[`pandoc.List:includes (needle, init)`]{#pandoc.List:includes}
: Checks if the list has an item equal to the given needle.