recital
README.md

Recital

Recital is a markup language and a set of parsers meant for writing prose, and can be used to convert a single document into Fountain, HTML, and Ink formats (and maybe more...?), as well as a series of tools for working with the format.

Recital was created by Amorphous for use in writing their games, stories, and personal projects. It wasn't intended for wider use, but I'd be pleased if you find it useful in your own creations.

How to write with Recital

See the Spec for how to write in Recital, and Output for what the JSON output looks like.

How to parse Recital text

If you want to write your own parser, import core and manipulate tokens as you see fit:

import { parseFlat } from '@a-morphous/recital'

const tokens = parseFlat(string);
for (let token of tokens) {
	// ...do something
}

If you want to convert Recital text directly into a format with an exporter, you can use that directly on the input string:

import { stageToHTML } from '@a-morphous/recital-stage-html'

const htmlText = stageToHTML(recitalString);

Repository Structure

NOTE: this project is built with pnpm. Do not use npm to install or update packages!

This repository is created as a pnpm workspace. The main Recital parser lives in the core directory, and the packages in the exporters directory take the objects produced by the Recital parser and exports them to various file formats.

Other miscellaneous packages, such as the syntax highlighter and Recital extensions, live in the packages directory. All packages can reference each other from any of those directories.

Run pnpm install and other commands as normal from within those sub-directories.