0 votes
by (170 points)
Is there developer documentation for the Twine 2 system, and if so, where does it live?

I'm looking specifically for docs that would help me add features to the editor UI, like image upload, or saving stories to a remote server instead of localStorage.  It would be great to also have more details on how the code is organized, what the core data structures are, how responsibilities are divided between the editor UI and the story formats, etc.

By the way, I'm willing to help write it if it doesn't exist, as I dig into these things, but was hoping to save myself some time ... :)

Best,
Ian

2 Answers

0 votes
by (68.6k points)
selected by
 
Best answer

There isn't any, aside from the source code.  See: https://github.com/klembot/twinejs

by (170 points)
Thanks, that's what it looked like, but I wanted to make sure.
0 votes
by (159k points)

>how responsibilities are divided between the editor UI and the story formats, etc.

The GUI application(s) is responsable for editing the conntent of the different type of Passages (TwineScript, JavaScript, CSS) that make up a Story Project, and for embedding those passage within the HTML template of a Story Format to create either a Story HTML file (in the case of the Publish to File option) or a Story HTML in-memory document structure (in the case of the Test or Play options).

The Story Format is responsible for everything else, including by not limited to:

a. The macro language (both the syntax and default list of macros)
b. The default HTML structure of the story and the HTML elements generated by the macros.
c. The default CSS based look & feel of the story.
d. The JavaScript Engine of the story format, both it's core functionality as well as the JavaScript API (if supplied) which can be use to access, and possible extend, that functionality.
e. [optional] The syntax highlighing feature of the GUI application' TwineScript Passage Editor.

...