On this page:
Element
Element
Element.style
Element.content
Content
Pre  Content
Content.to_  s_  exp
Pre  Content.to_  s_  exp
Content.to_  string
Content.width
Pre  Flow
Pre  Flow.to_  s_  exp
Flow  Block
Part
Part  Decl
Style
Style
Style.plain
Style  Like
Tag
Generated  Tag
Tag  Suffix
Taglet
Tag  Prefix
Tag.to_  s_  exp
Taglet.to_  s_  exp
9.0.0.6

3.9 Main Datatypes🔗ℹ

veneer

veneer Element

 

function

fun Element(

  content  :: Content,

  ~style: style :: maybe(Style || String || Symbol) = #false

) :: Element

 

property

property (e :: Element).style :: maybe(Style || String || Symbol)

 

property

property (e :: Element).content :: Content

Elements represent styled components of content, typically in a paragraph or nested in other elements. The styled components can be individual words, whole sentences, or longer runs of text, and they can have styling such as font or size changes.

Elements are typically constructed via functions like bold and larger, instead of using Element directly.

The Element veneer recognizes the same values as the Racket Scribble library’s element?.

See also MultiargElement, TraverseElement, PartRelativeElement, DelayedElement, CollectElement, and RenderElement.

annotation

Content

 

annotation

PreContent

 

annotation

Content.to_s_exp

 

annotation

PreContent.to_s_exp

Content is either a ReadableString, Element, MultiargElement, TraverseElement, PartRelativeElement, DelayedElement, a convertible value, or a list of Content. Convertable values includes images constructed via pict.

Pre-content is the same as content, but with the intent that decoding is applied to strings in content mode. For example, `` and '' are decoded into and .

Content.to_s_exp and PreContent.to_s_exp are converting annotations that produce a value suitable for interoperation with Racket Scribble libraries. In particular, they convert Rhombus lists to pair lists.

function

fun Content.to_string(content :: Content) :: String

 

function

fun Content.width(content :: Content) :: Int

The Content.to_string function converts content to a plain string, essentially extracting it’s “plain text.”

The Content.width function reports an approximate width in characters for the given content.

annotation

PreFlow

 

annotation

PreFlow.to_s_exp

A pre-flow is subject to decoding in flow mode. So, it includes PreContent, but also blocks and #void.

PreFlow.to_s_exp is a converting annotation that produces a value suitable for interoperation with Racket Scribble libraries. In particular, it converts Rhombus lists to pair lists.

annotation

FlowBlock

A flow block is a generalization of a paragraph, and FlowBlock includes Paragraph, NestedFlow, Table, Itemization, CompoundParagraph. TraverseBlock, and DelayedBlock,

The FlowBlock annotation recognizes the same values as the Racket Scribble library’s block?.

veneer

veneer Part

A part is a section, perhaps with subsections, or even a whole document. A part is normally constructed by decoding and not constructed or inspected directly, but see Part for information constructing and inspecting them.

The Parl veneer recognizes the same values as the Racket Scribble library’s part?.

annotation

PartDecl

A part declaration is created by functions such as section, and they are used by document decoding to construct a tree of parts.

veneer

veneer Style

 

function

fun Style(

  ~name: name :: maybe(Symbol || String) = #false,

  ~properties: properties :: Listable = []

) :: Style

 

value

def Style.plain :: Style

A style is metadata that is associated with an element or flow block. It affects rendering in a backend-specific way. For example, bold creates an element with a style that makes the text bold.

  • name: Symbol names are used to communicate certain style adjustments that are applicable to many backends, such as #'bold for bold text. String names tend to be used in a backend-specific way: the CSS class name for HTML output, or a Latex macro or environment name for Latex/PDF output.

  • properties: A list of values that further configure backend-specific choices. Again, symbol properties are often used for style adjustments that are applicable to many backends, or a property may be a value with more structure.

The Style.plain style is used as a default style that applies no effects when rendering.

The Style veneer recognizes the same values as the Racket Scribble library’s style?.

annotation

StyleLike

A StyleLike value can be coerced to a Style. It can be a Style already, a String, a Symbol, or a List.of(Symbol).

annotation

Tag

 

annotation

GeneratedTag

 

annotation

TagSuffix

 

annotation

Taglet

 

annotation

TagPrefix

 

annotation

Tag.to_s_exp

 

annotation

Taglet.to_s_exp

The Tag annotation recognizes values that work as tags, which includes GeneratedTags. The TagSuffix annotation recognizes values suitable for building a tag by putting it in a list with a symbol, such as #'part, or a list that can be turned into a tag by adding a symbol to the font. The Taglet annotation recognizes non-list TagSuffixes.

The TagPrefix annotation recognizes values that work as a tag prefix, which is a string or a ModulePath.

Tag.to_s_exp and Taglet.to_s_exp are converting annotations that produce a value suitable for interoperation with Racket Scribble libraries. In particular, they convert Rhombus lists to pair lists.