include
.include path:{String} sandbox:{ContextSandbox = ContextSandbox.SHARE} -> AnyThis function has two behaviors:
Reads a Quarkdown file and includes its parsed content in the current document, using the specified sandbox strategy to determine what information is shared between the main context and the included file's context.
Loads a library into the current context. Loadable libraries are fetched from the library folder (
--libsCLI option). sandbox is ignored in this case.
The context of the included file is always inherited from the main file, with an updated working directory that matches the included file's location. sandbox defines, instead, what information is shared back to the main file's context, and how. The following modes are listed in ascending order of isolation:
share(default): exchanges information bi-directionally. Changes made in the included file's context are reflected in the main file's context, and vice versa, allowing for full sharing of variables, functions and other declarations. This is represented by SharedContext.scope: likeshare, but the included file's context does not share new declarations (functions and variables) back to the main file's context. This is the behavior used within lambda blocks, such as foreach, and is represented by ScopeContext.subdocument: no information is shared back to the main file's context, only inherited from it. This also applies to the document info (metadata, title, etc.), This is the behavior used for subdocuments, and is represented by SubdocumentContext.
Return
the content of the file as a node if a file is included, or nothing if a library is loaded
Parameters
either a path (relative or absolute with extension) to the file to include, or the name of a loadable library
Throws
if the loaded Quarkdown source cannot be evaluated