Whenever a playback is paused the viewer can download the code to their machine in the paused state. Storyteller is programming language independent so as long as the viewer can compile or otherwise run the code they can experiment with it. Anyone who downloads the code can input different values into the running program, examine the output, and step through it in the same state as the code in the browser. The user can then alter those files in any way that they wish. They can also move the playback a little further and download them all again in a new state.
Tip: If the user performing the download does not wish to continue tracking changes to the code then VS Code and the Storyteller plugin are not even required. To download and examing code all one needs is a web browser.
After a viewer chooses to download the code, a zip file will be created on their machine with all of the files in
the exact same state as the code in the playback window. The zip file will have the same name as the root project
directory with a timestamp added to it. For example, with a root project directory named code
the zip file
will have a name like this: code-2018-02-08T19_33_01.655Z.zip
(the timestamp is when the download took
place to distinguish it from different downloads of the same code in different states). The project directory, code
,
will be directly inside the outer unzipped directory code-2018-02-08T19_33_01.655Z
.
Tip: You can continue to have Storyteller track code changes after a download
and those changes will be separate from the Storyteller project where the download occurred. This is equivalent to making
a branch in a traditional version control system. More about Storyteller version control can be found here
here.
In order to keep tracking changes in the downloaded project use VS Code with the Storyteller plugin to open the
root project directory with the code in it. In this example, it would mean using VS Code to 'Open a Folder' and then selecting the
directory called code
from the unzipped download (to make sure the correct directory is opened look for a
subdirectory called .storyteller
in it). Next, you can begin to edit the code and all of the changes will be
tracked in this new project.
There are three types of download that a viewer can use. The reason that there are different types of downloads is because Storyteller is also a version control system and the three download types are related to how a branch is made.
If the viewer is not using Storyteller in their editor for version control and they just want to download the code then it doesn't matter which option they choose (the default option is the most appropriate one). More information about using Storyteller as a version control system can be found here.
Tip: There will be an additional directory called .storyteller
in the unzipped project directory that is only used for tracking changes. If you are not tracking changes this can be
ignored.