2.2 Document Structure
Scribble parts (a generalization of “sections”) contain flow blocks (a generalization of “paragraphs”) that have content (a generalization of “text”).
A document is represented as a part, as reflected by the annotation Part. A part has three main components:
a title, which is is represented by content (in a specific sense defined below);
a sequence of flow blocks that determine the part’s text, also call a flow (i.e., a list of flow blocks is a flow in general); and
a list of subparts, each represented as a part, to be rendered after the part’s immediate flow.
A part is normally not constructed directly. Instead, a decoding process turns a #lang rhombus/scribble module body into a part. Functions like section and subsection create produce values that guide the decoding process to create subparts.
A flow block is a paragraph, a nested flow (which itself contains a flow sequence of flow blocks), a compound paragraph (which is like a nested flow, but rendered without per-block indentation, if any), an itemization (where each item has a flow), or a table (where each cell has a flow). A flow or an individual paragraph is not normally created directly, and instead created by the process of decoding, such as for a #lang rhombus/scribble module body. A paragraph can be constructed directly with para, while nested, itemlist, and tabular (among other functions) explicitly create other kinds of flow blocks. Each flow block also has a style.
A paragraph is the only kind of flow block whose content is not other flow blocks, and the technical term content refers to values that can be within a paragraph: strings, elements, convertible values, and and lists of content that are flattened into a paragraph. A convertible value is an object that follows a particular protocol; most notably, a Pict instance is a convertible value.
An element combines a style with nested content. For example, bold, italic, and larger create elements. The elem function creates an element with a specific style. An element can contain content, but an element cannot contain flow blocks or parts.
A style controls the rendering of an element or flow block. A style has an optional name that is a string or symbol, and it has a list of style properties. The effect of a style via its name and properties ultimately depends on the form that a Scribble document is rendered into and depends on the renderer, but various style names and properties are intended to have a portable and consistent effect. For example, a style with the name #'bold on an element is intended to make the element bold. A style property may be represented as just a symbol, or it may be represented as a more structured object.