Hello,
I just published a Lua filter for Pandoc that lets you organize a document in multiple files in a tree-like fashion, and assemble them later.
You can find it at
https://github.com/massifrg/pandoc-include-doc.
The filter supports the inclusion of sub-documents through Div elements, whose contents are replaced by the contents (the blocks) of an external file imported through pandoc.read().
Those Div elements have a "include-doc" class and must specify the source and the format in the "include-src" and "include-format" attributes.
Sub documents inclusion is
recursive and the filter detects possible circular references
in the inclusions' chains.
You could already assemble
a list of input files in Pandoc (i.e. see --file-scope in the
docs), this filter lets you organize your documents in a
tree-like structure.
Motivation: I wrote this filter because I'm writing a visual editor for pandoc types (= documents coded in the internal Pandoc format) based on Tiptap/Prosemirror.
Since the editor is
browser-based, the size of the documents it can handle is much
less than the size of the files converted by Pandoc, so it
makes sense slicing them into smaller units (i.e. chapter,
sections, etc.)
MF