This is an old revision of the document!
Entwine is a tool that makes building large stories with Twine 2 easier. It's a good fit if you would like to:
Entwine is a command-line tool that integrates with Grunt, which is a tool that automates repetitive tasks. If you don't have experience with Grunt or the command line, this can feel intimidating. It will take some setup work to use Entwine, but this document will guide you through it, and once you're done, your project will be able to build itself automatically as you make changes to its sources. That is, you'll be able to edit an image or change a passage and your project will automatically rebuild without you having to even choose Publish to File in Twine. For large projects, this tradeoff can be worth it.
npm install -g twine-utils. After that completes, running
entwine --helpwill acquaint you with the direct command-line interface, and the Grunt Entwine task's documentation also provides more information as to what the options do.
There is no Entwine plugin for Gulp or Brunch, other popular task runners for Node, and no current plans to create them.
As the title indicates, you only need to complete the steps in this section once on your computer. You will need to be connected to the Internet.
npm install -g gruntand press the Enter key. This command asks npm – short for the Node Package Manager – to install Grunt for you. The
-gpart ensures that you'll be able to use Grunt anywhere on your computer; it's installed globally.
npm will print out text as it installs Grunt. It's normal for npm to pause for a moment before printing any response, but not for more than a few seconds. It's busy searching for the files you'll need. When you see the prompt again after it completes, you're done.
You'll need to do the steps in this section each time you set up a new project. This document suggests a simple folder structure for your project, but you can use a different one if you prefer.
Given that, here's what to do. You will need to be connected to the Internet.
cdwith a space after it, then drag your project folder onto your terminal window. The resulting command should look like
npm init -yand press the Enter key. npm will create a file for you called package.json that we'll talk about in a second.
npm install –save grunt grunt-entwineand press Enter. npm will think for a moment, then install Grunt and Entwine for you.
mkdir srcand pressing Enter, or just create the folder the way you normally would.
If everything went correctly, you'll have three things in your project folder:
grunt entwine, which you installed in step 4 above.)