A modern Twine 2 story format built with Preact. Variables, macros, saves, settings, widgets, and full CommonMark markdown — all using a concise curly-brace syntax.
npm install @rohal12/spindle- Curly-brace macro syntax:
{if $health > 0}...{/if},{set $name = "Hero"} - Story and temporary variables with dot notation
- Full CommonMark markdown (GFM tables, strikethrough)
- Form inputs: textbox, numberbox, checkbox, radio, listbox, cycle
- Save system with playthroughs, quick save/load, and export/import
- Persistent settings (toggle, list, range)
- Reusable widgets
window.StoryJavaScript API for scripting- StoryVariables passage for strict variable declarations
import * as spindle from '@rohal12/spindle';
import { compile } from '@rohal12/twee-ts';
const result = await compile({
sources: ['src/'],
format: spindle,
});Or install both and let twee-ts auto-discover the format via the twine-story-format keyword.
Full docs at rohal12.github.io/spindle:
- Markup — Links, variables, macros, HTML, markdown
- Macros — Complete macro reference
- Variables — Story and temporary variables
- Special Passages — StoryInit, StoryVariables, StoryInterface
- Saves — Save system
- Settings — Toggle, list, and range settings
- Story API — The
window.StoryJavaScript API - Widgets — Reusable content blocks
- npm Package — Packaging guide
bun install
bun run test # run tests
bun run build # build format
bun run preview # build + compile dev story
bun run docs:dev # local docs dev server
bun run docs:build # build docs for deploymentThis is free and unencumbered software released into the public domain. See UNLICENSE.