Skip to content

Commit

Permalink
doc/lua-filters.md: document pandoc.List:iter method
Browse files Browse the repository at this point in the history
List objects have a new function `iter` that returns an iterator
function that returns the next list item on each call.
  • Loading branch information
tarleb committed Oct 14, 2024
1 parent c8fda8f commit 734227a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions doc/lua-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -4688,6 +4688,28 @@ Parameters:
`value`
: value to insert into the list

### `pandoc.List:iter ([step])` {#pandoc.list:iter}

Create an iterator over the list. The resulting function returns the
next value each time it is called.

Usage:

for item in List{1, 1, 2, 3, 5, 8}:iter() do
-- process item
end

Parameters:

`step`
: step width with which to step through the list. Negative step sizes
will cause the iterator to start from the end of the list. Defaults
to 1. (integer)

Returns:

- iterator (function)

### `pandoc.List:map (fn)` {#pandoc.list:map}

Returns a copy of the current list by applying the given
Expand Down

0 comments on commit 734227a

Please sign in to comment.