Skip to content

ChunkedDoc lua APIs #9061

Open
Open
@multimeric

Description

@multimeric

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 of Chunk objects (which don't have a constructor either).
  • Some mechanism for returning a ChunkedDoc from a lua filter, or otherwise wrap a ChunkedDoc inside a Pandoc 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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions