exporting to Twine and html

what is Twine?

Twine is a powerful open-source tool for editing and deploying nonlinear stories.

Loom can export trees as #.twee files, which can be opened in Twine1 (and Twine2 with some trouble), or built directly to html.

.twee

.twee is the file format for Twine Source Code.

You can use Twine's editor or edit .twee files directly to do things like adding hyperlinks, variables, and even running arbitrary Javascript code when the story is read (after building to html). You can also do things that aren't currently supported in Loom, like having multiple pasts converge on the same future.

Even if you don't edit the tree in Twine, exporting to .twee is useful for #exporting-to-html in readable story formats that can be opened outside Loom.

exporting to .twee

Export a tree to #.twee with File > Export > Export tree as .twee.

.twee advanced export options

  • Save visible only (default=false): Only export the subset of the tree currently visible in the map. For example, if leaves are pruned, they will not be included in the exported tree.

opening in Twine1

Twine1 can load the .twee files exported by Loom. To open Loom trees in Twine1:

  1. Download Twine1 here.

  2. Export as .twee from Loom

  3. In Twine1, go to Import > Twee Source Code and import the .twee file.

  4. If you get a "Passage Title Conflict" warning, choose "Yes" and replace with the imported passage.

opening in Twine2

Unfortunately, Twine2 can't open .twee files directly.

{TODO instructions for opening in Twine2}

building to html

Exporting to html is a great way to share your trees with anyone outside of the Loom app. The html file can be opened in any browser, and they can be added to a website.

building html using Twine1

Build to html in Twine1 using Build > Build Story.

building html using twee2

A quicker way to export to html if you aren't going to edit the file in Twine is to use twee2's command line tool:

  1. Export as .twee from Loom

  2. In the directory of your .twee file, run:

twee2 build mytree.twee mytree.html

built HTML examples

Some examples of html files exported from Loom and compiled with twee2:

Last updated