@@ -1479,3 +1479,106 @@ storage. The "media bag" is used when pandoc is called with the
14791479
14801480 local diagram_url = "https://pandoc.org/diagram.jpg"
14811481 local contents = pandoc.mediabag.fetch(diagram_url, ".")
1482+
1483+# Module pandoc.List
1484+
1485+Pandoc\'s List type and helper methods
1486+
1487+## Metamethods
1488+
1489+[`pandoc.List:__concat (list)`]{#pandoc.List:__concat}
1490+
1491+: Concatenates two lists.
1492+
1493+ Parameters:
1494+
1495+ `list`:
1496+ : second list concatenated to the first
1497+
1498+ Returns: a new list containing all elements from list1 and
1499+ list2
1500+
1501+## Methods
1502+
1503+[`pandoc.List:clone ()`]{#pandoc.List:clone}
1504+
1505+: Returns a (shallow) copy of the list.
1506+
1507+[`pandoc.List:includes (needle, init)`]{#pandoc.List:includes}
1508+
1509+: Checks if the list has an item equal to the given needle.
1510+
1511+ Parameters:
1512+
1513+ `needle`:
1514+ : item to search for
1515+
1516+ `init`:
1517+ : index at which the search is started
1518+
1519+ Returns: true if a list item is equal to the needle, false
1520+ otherwise
1521+
1522+[`pandoc.List:find (needle, init)`]{#pandoc.List:find}
1523+
1524+: Returns the value and index of the first occurrence of the
1525+ given item.
1526+
1527+ Parameters:
1528+
1529+ `needle`:
1530+ : item to search for
1531+
1532+ `init`:
1533+ : index at which the search is started
1534+
1535+ Returns: first item equal to the needle, or nil if no such
1536+ item exists.
1537+
1538+[`pandoc.List:find_if (pred, init)`]{#pandoc.List:find_if}
1539+
1540+: Returns the value and index of the first element for which
1541+ the predicate holds true.
1542+
1543+ Parameters:
1544+
1545+ `pred`:
1546+ : the predicate function
1547+
1548+ `init`:
1549+ : index at which the search is started
1550+
1551+ Returns: first item for which \`test\` succeeds, or nil if
1552+ no such item exists.
1553+
1554+[`pandoc.List:extend (list)`]{#pandoc.List:extend}
1555+
1556+: Adds the given list to the end of this list.
1557+
1558+ Parameters:
1559+
1560+ `list`:
1561+ : list to appended
1562+
1563+[`pandoc.List:map (fn)`]{#pandoc.List:map}
1564+
1565+: Returns a copy of the current list by applying the given
1566+ function to all elements.
1567+
1568+ Parameters:
1569+
1570+ `fn`:
1571+ : function which is applied to all list items.
1572+
1573+[`pandoc.List:filter (pred)`]{#pandoc.List:filter}
1574+
1575+: Returns a new list containing all items satisfying a given
1576+ condition.
1577+
1578+ Parameters:
1579+
1580+ `pred`:
1581+ : condition items must satisfy.
1582+
1583+ Returns: a new list containing all items for which \`test\`
1584+ was true.