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 --help
will 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 grunt
and press the Enter key. This command asks npm – short for the Node Package Manager – to install Grunt for you. The -g
part 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.
cd
command.cd "C:\Users\You\Documents\my-project"
.cd
with a space after it, then drag your project folder onto your terminal window. The resulting command should look like cd /Users/You/Documents/my-project
.npm init -y
and 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-entwine
and press Enter. npm will think for a moment, then install Grunt and Entwine for you.mkdir src
and 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
and grunt entwine
, which you installed in step 4 above.)