SubdocumentsData

data class SubdocumentsData<G : Graph<Subdocument>>(val graph: G, val withContexts: Map<Subdocument, Context>)

Immutable container of information about the subdocuments that are part of a document complex. A subdocument is a separate document file that can be rendered independently, and is referenced by a link from the main document or another subdocument.

This data is shared, meaning that all contexts involved in the document complex have access to the same subdocument graph and information, regardless of the sandboxing level. For instance, com.quarkdown.core.context.SubdocumentContext has strong isolation from the main document context, but can still access and modify the shared subdocument data.

Parameters

graph

directed graph of the subdocuments that are part of the document complex

withContexts

mapping of each subdocument in the graph to the context it is processed with

Constructors

Link copied to clipboard
constructor(graph: G, withContexts: Map<Subdocument, Context>)

Properties

Link copied to clipboard
val graph: G
Link copied to clipboard

Functions

Link copied to clipboard
fun addContext(subdocument: Subdocument, context: Context): SubdocumentsData<G>

Adds a new subdocument and its context to the current data, returning a new instance with the updated mapping.