Readteractive
Tool for writing and generating interactive books.
Install / Use
/learn @Carleslc/ReadteractiveREADME
Readteractive
Tool for writing and generating interactive books, also known as gamebooks.
Play this README as a gamebook!
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
- Install Python dependencies with:
- 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
- (Xcode Utils)
- Windows: Install make from Cygwin installer.
- Linux:
- (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.
- Linux:
CLI
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:

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:
- Plan your story. You can make a mind map with each of your narrative branches and which options follow which branch.
- Define each chapter and write them with Readteractive.
- 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.
- 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
- 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
qqbot-channel
346.8kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
100.1k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
346.8kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
summarize
346.8kSummarize or extract text/transcripts from URLs, podcasts, and local files (great fallback for “transcribe this YouTube/video”).
