Document¶
A document corresponds to a single disseminate source file. A document may contain sub-documents, which in turn may hold sub-documents, to form a tree. The top-level document is known as a root document and the root document and all sub-documents are known as a project.
Responsibilities¶
A document has the following responsibilities:
Managers. The root document is responsible to create managers. There should only be one of each type of manager in a project, and a project uses the same managers.
Rendering. The document is responsible for delegating rendering of the document in the target format(s).
Processors. When rendering a document, the ‘body’ entry in the context (i.e. the body of the disseminate source file) will be run through a list of processors, listed in the document class.
Conversion. Some documents types must be compiled or converted to their final format–e.g. to produce
pdf
targets, atex
target must be converted usingpdflatex
. The document manages this conversion as part of the rendering process.Context. A document owns a context that is populated by the disseminate file header, and which holds the variables used in rendering a document into a target format.
Paths. The document manages paths for the disseminate source file and the target files.
Definitions¶
Root document. A document that is not included as a sub-document to another document. The root document’s context will have objects, like the label manager, that are shared by its sub-documents in a project.
Project. A root document and zero or more sub-documents forming a document tree. Sub-documents are included by
include
statements in the header of the root document.doc_id. The document identifier for a document. It is unique for a document in a project.