{"id":21981675,"url":"https://github.com/soft/storytime","last_synced_at":"2025-10-30T17:43:02.942Z","repository":{"id":66599675,"uuid":"82081651","full_name":"Soft/storytime","owner":"Soft","description":"Choice-based interactive fiction system.","archived":false,"fork":false,"pushed_at":"2018-08-02T14:55:37.000Z","size":190,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-31T17:36:18.003Z","etag":null,"topics":["game-engine","haskell","interactive-fiction","server"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Soft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-15T16:31:45.000Z","updated_at":"2023-12-12T21:06:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"fd2f9098-b583-4b64-b53c-627fcd2ad777","html_url":"https://github.com/Soft/storytime","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Soft/storytime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soft%2Fstorytime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soft%2Fstorytime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soft%2Fstorytime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soft%2Fstorytime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Soft","download_url":"https://codeload.github.com/Soft/storytime/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soft%2Fstorytime/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266076350,"owners_count":23872741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game-engine","haskell","interactive-fiction","server"],"created_at":"2024-11-29T17:19:06.057Z","updated_at":"2025-10-30T17:43:02.878Z","avatar_url":"https://github.com/Soft.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Storytime 🌿\n\n[![Build Status](https://api.travis-ci.org/Soft/storytime.svg?branch=master)](https://travis-ci.org/Soft/storytime)\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](LICENSE)\n\nStorytime is a choice-based interactive fiction system. It features a simple\nplain-text format for writing stories and has a slick browser-based interface\nfor playing them out. Building more complex narratives is also supported through\nthe use of conditions and actions.\n\n## Installation\n\nStorytime is implemented in Haskell and currently the easiest way to install it\nis using Cabal packaging tool.\n\n~~~bash\ngit clone https://bitbucket.org/Soft/storytime\ncd storytime\ncabal install --only-dependencies\ncabal build\ncabal install --user\n~~~\n\n## Usage\n\nStorytime has a support for multiple different interfaces for viewing content.\nCurrently, a web-based viewer and a simple terminal-based viewer are included.\n\n~~~bash\nstorytime [-V|--validate] [-i|--interface INTERFACE] FILE\n~~~\n\nFor example, the web-based viewer can be launched by simply running the command:\n\n~~~bash\nstorytime adventure.story\n~~~\n\nRunning the command automatically opens the web browser pointing at the viewer\nplaying out story from file `adventure.story`.\n\nThe `--validate` switch instructs Storytime to perform some simple diagnostics\non the story file and exit.\n\n## Language\n\n### Sections and Links\n\nSections are the backbone of Storytime documents and every piece of fiction must\nhave at least one of them. One can define a new section by starting the line\nwith an asterisk and following it with section's name. Section names have to\nbegin with a letter and can contain alphanumeric characters, hyphen (-) and\nforward slash (/).\n\n~~~\n* beginning\n\nOnce in a far away land...\n\n[castle]: Explore the castle\n[invest]: Become a fairly successful middle manager at a mid-sized investment bank\n\n* castle\n\nYou gaze upon the steep walls of the fortress. Climbing them would certainly be\na hurdle.\n\n* invest\n\nOn a whim, you decide to look for lucrative investment opportunities in the\nderivatives market.\n\n~~~\n\nLinks connect the sections together and make the story come to live. Links have\nto be listed after the content of a section. In the most basic form, a link\nconsists of a target and a title.\n\n### Variables and Conditions\n\nIt is sometimes useful to have conditional links between sections. Conditional\nlink is only visible if a specified condition is met. Conditions are simple\nboolean expressions. Here are a few examples of valid conditions:\n`numberOfDragons \u003e 900`, `a = b \u0026\u0026 b \u003e 10`, `~(a = 1) || (a = 1)`. One can\nadd a condition to a link by following the target with a bar (|) and the\ncondition. For example:\n\n~~~\n\n* example\n\n[another | a \u003e 5]: This link is only visible if 'a' is greater than five.\n[another | ~(a \u003e 5) ]: This link is only visible if 'a' is not greater than five.\n\n* another\n\nHurrah!\n\n~~~\n\nLinks can also modify variables. The modifications only take place if the link\nis followed. If the player can use the link multiple times (for example, if the\nsections form loops), the modifications are executed every time. One can add\nmultiple actions to a single link by separating them with a comma, the actions\nwill be executed from left to right. \n\n~~~\n* engaging-section\n\nLoop!\n\n[engaging-section | a \u003c 9, +a]: This link leads to the same section and increments 'a' by one every time it is followed. The link will disappear after 'a' becomes greater than ten.\n[end| a \u003e 8]: Forward\n\n* end\n\n...that was quite enough\n\n~~~\n\nActions can contain simple integer expressions. For example, the following are\nall valid actions `a = a + 10`, `+power`, `-enemies`, `price = (a * b + c) - d`\n\nHere's another example:\n\n~~~\n* first\n\nSome text...\n\n[second, rubber-chicken = 1, points = points + 50]: Take the rubber chicken\n\n* second\n\n~~~\n\n### Conditional Content\n\nSections can also include conditional content. Example bellow demonstrates this:\n\n~~~\n* section\n\nWhat a fate! To be lost in an infinite maze of cubicles.\n${rubber-chicken\u003e0: Luckily you have your trusted rubber chicken with\nyou.}${~(rubber-chicken\u003e0): To make matters worse, you left your rubber chicken\nat home.}\n\n~~~\n\n### Section Actions\n\nSections can also have actions associated with them. The actions are executed\nevery time player views the sections.\n\n~~~\n* example, +turn, price = price * 2\n\n...\n~~~\n\n### Miscellanea\n\nStorytime documents can start with a metadata block. How the metadata will be\nused depends on the selected viewer.\n\n~~~\n% title: A Witty Title\n% author: John Doe\n\n* first-section\n\n...\n~~~\n\n## Examples\n\nThe embedded scripting language can be used to do all kinds of things that might\nnot be immediately useful for writing interactive fiction. For example, one\nmight make a story that calculates the Fibonacci sequence:\n\n~~~\n* init, a = 1, b = 2, num = (a + b)\n\n${a}, ${b}...\n\n[fib]: Reticulate splines\n\n* fib\n\n${num}\n\n[fib, a = b, b = num, num = (a + b)]: Fibonacci!\n~~~\n\nThe examples folder in the repository contains few example stories.\n\n## Emacs\n\nAlthough Storytime files can be edited using any text editor, Storytime comes\nwith a dedicated major mode for Emacs. `storytime-mode` supports syntax\nhighlighting and provides a few useful key bindings for Storytime specific\nfunctionality.\n\nKey           | Action\n------------- | ---------------------------------\n`C-c C-c`     | Play through the current story\n`C-c C-o`     | Follow link\n`C-c C-j`     | Jump to header\n`C-c C-s h`   | Insert header\n`C-c C-s l`   | Insert link\n\n\n## Bugs\n\nStorytime is still at the experimental stage of development and bugs are bound\nto occur from time to time. Bug reporst can be filled at the\n[issue tracker hosted at BitBucket](https://bitbucket.org/Soft/storytime/issues).\n\n## License\n\nStorytime is distributed under the GNU General Public License version 3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoft%2Fstorytime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoft%2Fstorytime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoft%2Fstorytime/lists"}