Snowman is an advanced Twine 2 story format designed for people who already know JavaScript and CSS. It was originally created by Chris Klimas and is currently maintained by Dan Cox.
The official Snowman documentation has more details.
Snowman does not use macros as found in sister story formats Harlowe and SugarCube. Instead, it provides template tags, <% ... %>, and a JavaScript API for accessing and manipulating the current story and its passages.
It also includes the JavaScript library jQuery.
To use Snowman as a story format in Twine 2:
- Open Twine 2.
- Go to Twine in the top-level menu.
- Click on Story Formats.
- In the sidebar, click on Add.
- Enter the JSONP URL for the version you want to use from the builds page
For example, to install the latest 2.X version, use:
https://videlais.github.io/snowman/builds/2.X/format.jsSnowman development is organized into major version branches:
- 1.X Branch - Legacy version
- 2.X Branch - Current stable version
- Main Branch - Development version
To create a new build of Snowman from this repository:
-
Install dependencies:
npm install
-
Run the build process:
npm run build
-
Package the story format:
npm run package
The compiled story format will be available in the dist/ directory as format.js.
For a complete build including linting and testing, use:
npm run allFor validation without coverage (faster):
npm run validateFor complete validation with coverage:
npm run validate:fullRun unit tests:
npm testRun end-to-end tests (requires compiled HTML files):
npm run test:e2eCompile e2e test files and run tests in one command:
npm run test:e2e:compileRun all tests with coverage:
npm run test:allThe e2e tests require HTML files to be compiled from .twee source files using ExTwee. The repository includes a compilation script:
bash compile-e2e-tests.shThis script compiles all .twee files in the test/e2e/ directory to HTML files using the current story format. The test:e2e:compile npm script combines this compilation step with test execution for convenience.