3.1 Typesetting Code
expression | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
expression | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
expression | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Use #,(expr) within group to escape from literal mode and substitute the element produced by expr.
A builtin_space or space name after ~at supplies the initial space to use for creating hyperlinks in group based on meta_label imports.
Typesetting and hyperlinking can be adjusted via spacers, which can select an alternative space for components of group for hyperlinking. That is, a supplied builtin_space or ~at space_name specifies the initial space of group, but a spacer binding can determine the space of subsequent elements of group.
Even before applying spacers, identifiers in group bound as typesetting transformers are replaced with their transformations. That’s how metavariables get typeset as italic, for example: each metavariable is bound as a transformer that adds the ~var space to the identifier.
expression | |
| |
| |
expression | |
| |
| |
expression | |
|
expression | |
|
Note that when you use @ notation to call rhombusblock, then no comma is required between groups that are on separate lines. So, for example,
fun add(x, y):
x + y
add(1, 2)
)
renders as
fun add(x, y):
x + y
add(1, 2)
without adding a comma after the add definition. If the source does contain a comma, then is preserved in the output.
expression | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
expression | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
|
~escape: Replaces the escape operator #, with op so that #, is literal (assuming that op is different from #,).
~inset: Insets the block relative to surrounding text if the body sequence after ~inset produces a true value. The default is to inset.
~indent: Adds space before each line of the block to indent by the amount produced by the body sequence after ~indent. The indentation amount must be a nonnegative integer that is treated as a character count. The default is 0 indentation.
~prompt: Uses the string produced by the body sequence after ~prompt as a prompt that prefixes the first line of the content, and lines afterward get the same number of spaces as characters in the prompt. The default is to show no prompt, which is equivalent to an empty string.
~indent_from_block: Uses the indentation of the block overall, instead of the first item in the block, to infer relative indentation for rendered content if the body sequence after ~indent_from_block produces a true value. The default is true.
~spacer_info_box: If the body sequence after ~spacer_info_box produces a box, and if the same box is used for multiple rhombusblock_etc forms, then spacer information is shared across the forms. For example, when forms a is treated as bindings that associates an annotation with an identifier, that association can persist for later blocks. The default is for each block to collect independent spacer information.
~number_from: If the body sequence after ~number_from produces a value other than #false, it must be a number to write to the left of the first line of rendered output, and subsequent lines are numbered accordingly.
definition | |||
|
expression | |
| |
| |
expression | |
| |
| |
expression | |
|