Gutenberg

Namespace Gutenberg

Classes

Alignment

How to behave when composing two Box<T>es with mismatched sizes.

Box<T>

Represents an immutable two-dimensional rectangular box of text. The box can be rendered by an IDocumentRenderer<T> or laid out as part of a Document<T>.

Document<T>

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 IDocumentRenderer<T>.

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>;

DocumentExtensions

Contains extension methods for Document<T>.

LayoutMode

The layout mode

LayoutOptions

Options for laying out a Document<T>.

PageWidthOptions

Information about the available width for layout

Interfaces

IDocumentRenderer<T>

An interface for objects which know how to render a Document<T>.

IPrettyPrintable<T>

An interface for objects which can render themselves as a Document<T>.