How to behave when composing two Box<T>es with mismatched sizes.
Represents an immutable textual document which can be laid out in a variety of ways. Once laid out, the document can be rendered by an IDocumentRenderer<T>.
A Document<T>'s layout is determined by the available page width, the locations of line breaks within the document, and the locations of groups within the document.
The page has a certain maximum width (determined by PageWidth), which the layout algorithm tries not to exceed, by inserting line breaks where possible. The possible line breaks are indicated by the presence of LineBreak values within the document.
A document may contain groups, introduced by the Grouped() method. A group indicates a "flattenable" region within a document. When the layout algorithm encounters a group, it will attempt to flatten the group into a single line. If the result does not fit within the page width, the group is rendered without changes. Groups give the layout algorithm flexibility to choose the "best" way to display a document, by using the available horizontal space efficiently.
The document may contain annotations - values of type
T - which can be interpreted by the
This class is intended to be imported under an alias,
since typically the type of annotations won't change within your code:
using Doc = Gutenberg.Document<MyAnnotation>;.
Contains extension methods for Document<T>.
The layout mode.
Options for laying out a Document<T>.
Information about the available width for layout
An interface for objects which know how to render a Document<T>.
An interface for objects which can render themselves as a Document<T>.