Skip to content

rohal12/spindle

Repository files navigation

Spindle

npm version npm downloads CI last commit license TypeScript docs

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.

Documentation

Install

npm install @rohal12/spindle

Features

  • 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.Story JavaScript API for scripting
  • StoryVariables passage for strict variable declarations

Usage with twee-ts

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.

Documentation

Full docs at rohal12.github.io/spindle:

Development

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 deployment

License

This is free and unencumbered software released into the public domain. See UNLICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages