« Home

Gordian Placeholders

Placeholders are a lightweight alternative to templates, for reusing text that requires little processing. A placeholder can be used in the text with Twine-variable-like syntax, e.g. $placeholer

Defining Placeholders

Placeholders are declared inside the gb-placeholders passage. The passage should contain a single JSON Object whose keys are the placeholder names and whose values are the placeholder contents. For example:

Note that a piece of placeholder text can refer to a previous placeholder with $placeholdername. This doesn't work the other way around, a placeholder can only refer to a placeholder defined earlier in the list, not later.

Using Placeholders

In passage text, you can use a placeholder by prefixing its name with a dollar sign. For example:

Placeholder Templates

If Gordian sees a $placeholder and it doesn't match a placeholder it will convert it into a template call instead, so that $placeholder becomes <t:placeholder></t>. In this way you can use either placeholders or templates for your reusable text, whichever makes the most sense to you.