Crate texttale

source ·
Expand description

§TextTale

TextTale provides tools for writing text-mode adventures.

§Status

Active development. TextTale is likely to change in the near future in backwards-incompatible ways. No changes are planned, but the library is immature.

§Scope

Macros and functions for telling stories. TextTale makes it easy to write a story that can be run interactively and then replayed. See the scripts/ folder and src/bin/texttale.rs for an example.

§Warts

  • Tests are run in repo using a combination of shell scripts and the expect interface.

§Documentation

The latest documentation is always available at docs.rs.

Macros§

  • An menu is a series of interactive prompts to be answered in order. Where a story provides choice via branches, an menu sequences prompts in-order and expects an answer to each prompt.
  • A story always takes the same form. It is addressed to the method that it will generate for the author. It is always followed by the prompt that will be displayed when the user asks for help. Then, it’s a sequence of commands that need to be interpreted.

Structs§

  • An ExpectTextTale gives an adventure that gets recorded and compared against the input. It’s intended to run the script and compare its output to the file. See CHECKSUMS.zsh for an example of the tests in the scripts/ directory.
  • A ShellTextTale gives an interactive shell for testing. It’s intended to be interactive.

Enums§

Traits§

  • A TextTale creates a text-mode adventure by feeding the next command from the command prompt as a string. Will return None when the user kills the session or the underlying writer is exhausted.