YarnSpinner is the language in which
.yarn files are written. You can check out the
official documentation for the YarnSpinner language, however, here we will be describing the
Jenny implementation, which may not contain all the original features, but may also contain
some that were not implemented in the YarnSpinner yet.
Any Yarn project will contain one or more
.yarn files. These are plain text files in UTF-8
encoding. As such, they can be edited in any text editor or IDE.
.yarn files helps you better organize your project, but Jenny doesn’t impose any
requirements on the number of files or their relationship.
// This is a comment // The line below, however, is a tag: # Chapter 1d <<declare $visited_graveyard = false>> <<declare $money = 25>> // is this too much? title: Start --- // Node content ===
The commands are explained in more details later, but at this point it is worth pointing out that only a limited number of commands are allowed at the root level of a file (that is, outside of nodes). Currently, these commands are:
The commands outside of nodes are compile-time instructions, that is they are executed during the compilation of a YarnProject.
Nodes represent the main bulk of content in a yarn file, and are explained in a dedicated section. There could be multiple nodes in a single file, placed one after another. No special separator is needed between nodes: as soon as one node ends, the next one can begin.