SharedContext
A context that shares all of its properties with its parent MutableContext. This is useful when a context needs to be forked, for example to update its fileSystem, but still its state mutably.
Parameters
context this shared context was forked from
file system to use in this context
Properties
The pipeline this context is attached to, if it exists. A context can have up to 1 attached pipeline.
Mutable information about the final document that is being created.
The error handler of the attached pipeline, if it exists.
External libraries that can be loaded by the user into libraries. These libraries are, for instance, fetched from the library directory (--libs option) and can be loaded via the .include {name} function.
Tables that store key-value localization pairs for each supported locale. Each table is identified by a unique name.
Media storage that contains all the media files that are referenced within the document. For example, if an image node references a local image file "image.png", the local file needs to be exported to the output directory in order for a browser to look it up. This storage is used to keep track of all the media files that may need to be exported.
The set of permissions granted to this holder.
The root file system used to determine whether a file resides within the project directory. If null, all file reads are considered global (requiring Permission.GlobalRead).
Data about all the subdocuments that are part of the document complex. This data is shared across all contexts involved in the document complex, regardless of the sandboxing level.
The directed graph of subdocuments that are part of the document complex.
Functions
Returns a copy of the queue containing registered function calls and clears the original one.
Looks up a function by name.
Retrieves the relative path to the root of the file system. The root of the file system is determined by the working directory of the current subdocument.
Loads a loadable library by name and registers it in the context. After a successful load, the library is added to libraries, with its Library.onLoad action executed.
Localizes a key from the stdlib table. If the key is not found in the context's locale, it falls back to the default locale (English).
Performs an action locking the enqueuing of function calls. This causes register to do nothing until the action is completed. Any function call enqueued during the action is discarded and won't be expanded by the pipeline.
Generates a new UUID via ContextOptions.uuidSupplier.
Enqueues a new FunctionCallNode, which is executed in the next stage of the pipeline. Nothing happens if enqueuing is locked via lockFunctionCallEnqueuing.
Throws a MissingPermissionException if the required permission is not granted to this holder.
Throws a MissingPermissionException if the holder does not have the required permission to read the given file. The required permission depends on whether the file is inside the project directory (Permission.ProjectRead) or outside it (Permission.GlobalRead).