SkillAgentSearch skills...

Readteractive

Tool for writing and generating interactive books.

Install / Use

/learn @Carleslc/Readteractive

README

Readteractive

Tool for writing and generating interactive books, also known as gamebooks.

Play this README as a gamebook!

ko-fi

Overview

<!-- toc --> <!-- tocstop -->

What is a gamebook?

A gamebook is a work of printed fiction that allows the reader to participate in the story by making choices. Gamebooks have been influenced by Choose Your Own Adventure Series and tabletop role-playing games.

<p align="center"><img src="https://i.imgur.com/DsFtxu8.png"></p>

Production of new gamebooks in the West decreased dramatically during the nineties as choice based stories have moved away from print based media, although the format may be getting a new lease of life on mobile and ebook platforms. Such digital gamebooks are considered interactive fiction.

Getting started

Clone this repository with git or download the current version as zip.

Install dependencies

Note for Windows: It is easier to install these dependencies and run Readteractive with a linux-like shell like Cygwin.

  • Python 3: Needed to process structure and build Markdown files used to generate your book.
    • Install Python dependencies with: pip install -r requirements.txt
  • Make: Needed to bundle commands and generate your books in any format.
    • Linux: apt-get install build-essential
    • Mac OS:
      • (Xcode Utils) xcode-select --install
      • Or, using Homebrew: brew install make
    • Windows: Install make from Cygwin installer.
  • (HTML, PDF, EPUB) Pandoc: Needed to generate HTML, PDF and EPUB from Markdown files.
  • (MOBI, Optional) KindleGen: Needed to generate MOBI from EPUB file.
    • It is included installing Kindle Previewer, also used to preview how your MOBI files look in tablet and Kindle devices.
  • (Optional) librsvg: Convert SVG images for being used inside PDF
    • Linux: apt-get install librsvg2-bin
    • Mac OS, using Homebrew: brew install librsvg
    • Windows: Install librsvg2 from Cygwin installer.

CLI

CLI repository

A yeoman generator for scaffolding Readteractive books.

We provide a command line interface to easily generate your project doing scaffolding, so you don't need to remember the syntax of each file and you can just focus on writing.

The Readteractive structure and files can be automatically generated using this CLI for your custom book.

It also provides a tool for visualization of your book with current chapters and the links between them, so you can have a general overview of the narrative branches of your book.

For instance, this is the generated graph for this tutorial interactive book:

tutorial graph of chapters links

Install CLI and boost your productivity with Readteractive!

Readteractive structure

Top folder

In the top folder there are the required files for building your books and configure dependencies. Please, do not edit or move these files to another folder or build will fail.

.
├── .git
├── .gitignore
├── book.py
├── chapter.py
├── get_property.py
├── process_book.py
├── pandoc-html.css
├── makefile
├── requirements.txt
├── LICENSE
├── README.md

Books and chapters folders

Every book and chapter you generate needs to match the following structure:

.
├── book-example/
│   └── _meta.yml
│   └── first_chapter/
│       ├── first_chapter.md
│       └── first_chapter.yml
│   └── second_chapter/
│       ├── image.png
│       ├── second_chapter.md
│       └── second_chapter.yml
│   └── cover.png
│   └── stylesheet.css

This structure and files can be automatically generated using our CLI for your custom book.

Syntax of .yml files is based on YAML.

Syntax of .md files is based on Markdown.

Syntax of stylesheet.css file is based on CSS, but this is optional as explained later.

Book metadata

_meta.yml

title: Example _gamebook_
author:
- First Author
- Second Author
start: first_chapter
language: es
cover-image: cover.png
stylesheet: stylesheet.css
description: |
    This is the description of your book.
    Hope you enjoy writting with Readteractive.
github: https://github.com/user/repo
  • (Required) Title: The title of your book. You can use Markdown here using **bold** and _italic_.
  • (Optional) Author: The author of your book, or a list of authors. You can use Markdown here using **bold** and _italic_.
  • (Optional) Starting chapter: The chapter id (folder) of the first chapter in the book. Defaults to the first alphanumerically chapter.
  • (Optional) Language: ISO 639-1 Language Code. Defaults to en (English).
  • (Optional) Cover Image: File of the main image of your book.
  • (Optional) Stylesheet: The CSS stylesheet of your book.
  • (Optional) Description: The description of your book.
  • (Optional) GitHub: GitHub repository URL. Displays a corner ribbon link in the HTML version.

Chapter

chapter-id.yml

title: Example _chapter_

You can use Markdown here using **bold** and _italic_.

chapter-id.md

The text of your chapter. You can use Markdown here.

Chapters order

It is true that a gamebook does not have a strict order for chapters because users can jump from one to another according to the options they decide to follow, but sometimes is more elegant to have chapters sorted by narrative branch or other order you decide.

Once book is built, the first chapter shown will be the chapter specified in _meta.yml (if provided). The following chapters are shown in alphabetical order, but you can define your own order giving a numerical prefix to chapter identifiers like in this example:

.
├── book-example/
│   └── _meta.yml
│   └── 0-before/
│       ├── 0-before.md
│       └── 0-before.yml
│   └── 1-after/
│       ├── image.png
│       ├── 1-after.md
│       └── 1-after.yml

In this example, assuming that no start is set inside _meta.yml, the first chapter to show up will be 0-before, followed by 1-after.

How to write your book

A gamebook has many chapters with links between them. We refer to a chapter as a step with description in one of your narrative branches.

If you have no previous experience writing gamebooks these are some tips:

  1. Plan your story. You can make a mind map with each of your narrative branches and which options follow which branch.
  2. Define each chapter and write them with Readteractive.
  3. Visualize your chapter graph with our CLI whenever you need to have an overview of your book and ensure each chapter have the links you want.
  4. Build your book from time to time to have a look of how it is looking.

How to write options

Each chapter can link to many different chapters using the following syntax:

(Text -> [next])

Replace Text with your custom option text. Replace next with the chapter id which this link is pointing to.

Readteractive will generate a link to the chapter on your book for every reference following this syntax.

You can use Markdown in Text.

You can skip the chapter prefix defined for custom order at the moment of writing an option in next:

(Go to after -> [after])

This option has the same effect than (Go to after -> [1-after]) and (Go to after -> [1_after]). This prefix skipping only works for digits followed by - or _.

How to build your book

If you have all dependencies installed is as easy as executing one command:

make BOOK=book-example

This will ensure your book and chapters structure is right, check for broken links between chapters and then pack and build your book in different formats:

  • HTML
  • PDF
  • EPUB

You can also build only the desired format:

make html BOOK=book-example
make pdf BOOK=book-example
make epub BOOK=book-example
make mobi BOOK=book-example

Each chapter will generate a header in the table of contents of the PDF, EPUB and MOBI metadata, and each option will have a clickable link that jumps to the next chapter page.

The PDF version uses [LaTeX](https://en.wikipedia.org/wi

Related Skills

View on GitHub
GitHub Stars56
CategoryContent
Updated17h ago
Forks7

Languages

HTML

Security Score

85/100

Audited on Apr 2, 2026

No findings