Skip to content

Style Guide#

The Twine Cookbook uses certain conventions to indicate text should be considered macros, part of JavaScript, or values to be used with either.

HTML and Macros#

All HTML and macro names (such as those used in Chapbook, Harlowe, and SugarCube) are escaped. They will appear like this <div> for HTML and this <<include>> for macros. This is done for easily allowing users to copy and paste the text from the Cookbook into Twine 2.


This example uses the HTML element <div> and the macro (display:).

Variables and JavaScript Functions#

All variables are highlighted with emphasis. If a story format provides or an example uses particular JavaScript functionality, it will appear with strong emphasis.


This example uses the variable exampleValue and uses the global object window and function parseInt().

Quotation Marks#

In some cases, the value of a variable is shown in quotation marks. This is to help users see which values are used and how they might be transformed or inform certain functionality.