I wrote a gamebook engine. A gamebook (also known as a "choose-your-own-adventure" story) is a type of interactive fiction which lets a reader control the direction of the story by selecting among choices on-screen. This engine uses JavaScript to allow a reader to click links to progress through a gamebook you write in HTML....

Detailed information on how to use the engine to write your own gamebook.
Sample gamebook
A gamebook that shows off a few of the engine's features. You can poke around its source to see how it tells the gamebook engine what to do.
A stylesheet for gamebooks. Mostly customizable to suit your own preferred style, or just use as-is.
The main JavaScript file. You'll need this to run your gamebook.
A commonly-used helper library; the game engine depends on this file.
An optional script by Kelly Martin to convert straight quotes in your story to "smart" quotes.