Use this tag for questions that are related to multiple documents in one file. multi-document can be format specified (e.g. YAML), or by repeating a format that can be expressed in single line (JSON)
Multiple documents in one file are often used to keep together information that is related but doesn't necessarily be processed
in the same way. It has the advantage over e.g. having multiple files
with different suffices (.meta
, .doc
) that the documents cannot be separated on the filesystem level.
Some formats have multi-documents built in from their specification (e.g. YAML). But essentially any format that can be separated by a character sequence that cannot occur as part of the format itself, or for which an explicit or implicit "closing" can be detected (e.g JSON) can be combined into a multi document file.
One multi-document form for JSON is where each document is a single line, which can be separetely parsed.
A routine to deal with such combination multi-line documents can be written on top of a standard parser for such documents, and libraries that provide that functionality are e.g. available for Python (multiline
, json-lines
).