Open
Description
I've had a read of #6122, and I think there's still a need for a general chunking mechanism accessible to lua. Currently the only (?) lua API for working with a ChunkedDoc
is pandoc.structure.split_into_chunks
, which returns one, but it can't be used any further.
Describe your proposed improvement and the problem it solves.
I think there are two necessary tools to make this fully configurable for users in lua:
- Ideally, a constructor for
ChunkedDoc
so we don't have to, for example, include headers in each chunk and then split the document. I imagine the constructor would just take a list ofChunk
objects (which don't have a constructor either). - Some mechanism for returning a
ChunkedDoc
from a lua filter, or otherwise wrap aChunkedDoc
inside aPandoc
so it can be returned from lua.
Describe alternatives you've considered.
In theory a user could write a filter that converts the document into a series of divs with a header, and ask the user to --to chunkedhtml --split-level 2
, but this pushes too much onto the user when ideally it could all be automated.