Tapestry
Source Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Format

Text printing and output control. The default Tapestry runtime will process printed text according to its [markup rules](https://pkg.go.dev/git.sr.ht/~ionous/tapestry/web/markup).

Definitions:

Slots:

  • Counter: A slot used internally for generating unique names during weave.

Commands:

  • Bracket: Collect printed text and surround the output with parenthesis '()'.
  • Buffer: Capture any and all text printed by the game, and return it as a single string of continuous text.
  • Cycle[name:]text: Returns some text selected from a set of predefined values.
  • LineBreak: Start a new line.
  • ParagraphBreak: Add a single blank line ( unless a blank line was just written ).
  • Print: Display some text to the player.
  • Print[separator:]words: Collect printed text and separate that text by single spaces.
  • Print commas: Separates words with commas, and 'and'.
  • Print count: Express an integer in plain english ( aka a cardinal number ).
  • Print num: Express a number using digits.
  • Print row: Group text into a single line <li> as part of a list of lines.
  • Print rows: Group text into an unordered list <ul>.
  • Shuffle[name:]text: Returns some text selected from a set of predefined values.
  • SoftBreak: Start a new line ( if not already at a new line ).
  • Stopping[name:]text: Returns some text selected from a set of predefined values.

Commands

Collect printed text and surround the output with parenthesis '()'. If no text is printed, no parentheses are printed.

Slots:

Terms:

Bracket: Execute repeats

Runs one or more statements, and collects any text printed by them.

Capture any and all text printed by the game, and return it as a single string of continuous text. New lines are stored as line feeds ('\n').

Slots:

Terms:

Buffer: Execute repeats

The statements to capture text output from.

Returns some text selected from a set of predefined values. When called multiple times, this returns each one of the values in their specified order, then it loops back to the first value again.

Slots:

Terms:

name: optional Text

An optional name used for controlling internal state. When omitted, weave automatically generates a globally unique name. Commands with the same name will share internal state.

text: TextEval repeats

One or more pieces of text to cycle through.

Start a new line. See also the <br> markup.

Slots:

Terms:

None.

Add a single blank line ( unless a blank line was just written ). See also the <p> markup.

Slots:

Terms:

None.

Display some text to the player. The default runtime will format the text according to the rules specified by the Tapestry markup package: https://pkg.go.dev/git.sr.ht/~ionous/tapestry/web/markup

Slots:

Terms:

Print: TextEval

The text to print.

Collect printed text and separate that text by single spaces.

Slots:

Terms:

separator: optional TextEval

Optional text to place between adjoining words.

words: Execute repeats

Runs one or more statements, and collects any text printed by them.

Separates words with commas, and 'and'.

Slots:

Terms:

commas: Execute repeats

Express an integer in plain english ( aka a cardinal number ). For example, given the number `12` return the text "tweleve". It converts floating point numbers to integer by truncating: given `1.6`, it returns "one".

The [story.Execute] version prints the text for the player.

Slots:

Terms:

count: NumEval

The number to change into words, or to print.

Express a number using digits. For example, given the number `12` return the text "12".

The [story.Execute] version prints the text for the player.

Slots:

Terms:

num: NumEval

The number to change into text, or to print.

Group text into a single line <li> as part of a list of lines. See also: 'rows'.

Slots:

Terms:

row: Execute repeats

Runs one or more statements, and collects any text printed by them.

Group text into an unordered list <ul>.

Slots:

Terms:

rows: Execute repeats

Runs one or more statements, and collects any text printed by them.

Returns some text selected from a set of predefined values. When called multiple times, this returns each one of the values in a randomized order. After returning all of the available options, it begins again with a new ordering.

Slots:

Terms:

name: optional Text

An optional name used for controlling internal state. When omitted, weave automatically generates a globally unique name. Commands with the same name will share internal state.

text: TextEval repeats

One or more pieces of text to shuffle through.

Start a new line ( if not already at a new line ). See also the <wbr> markup.

Slots:

Terms:

None.

Returns some text selected from a set of predefined values. When called multiple times, this returns each of its inputs in turn. After returning all of the available options, it sticks to using the last option.

As a special case, if there was only ever one option: it returns that option followed by nothing ( the empty string ) forever after.

Slots:

Terms:

name: optional Text

An optional name used for controlling internal state. When omitted, weave automatically generates a globally unique name. Commands with the same name will share internal state.

text: TextEval repeats

One or more pieces of text to shift through.