Ephemeral Writing
 

An Introduction to Ephemerald

Ephemerald is a tool for writing procedural text. It is a nicer interface to a tool called Tracery with the goal of making procedural text generation available to non-programmers in a super streamlined form. Ephmeral Writing was created by Martin Pichlmair.

What does it do? It allows you to procedurally generate text. You can use that text to feed twitter bots, to create SVG images, to name your child or for any other purpose where you want to have varied, partially randomised text.

How does it do that? You, the writer, provide text that has blank spaces. Then you provide different snippets of text to go into those blank spaces. The software randomly selects pieces every time you tell it to. That way your text varies over time.

Getting Started

You are working with a simple text file when writing in Ephemerald. Everything you do goes into a single file.

There are two core concepts: rules and expansions. A rule is a list of options and its name goes in square brackets. You can have as many rules as you want in your file.

[heister]
Alice O'Rourke
Frank Diob
Jimmy Tartufi
Winnie He

The above rule (heister) has 4 options, each of them the name of a different heister.

An expansion expands a rule (i.e. it picks a candidate from the list of options). Writing #heister# expands the above rule called [heister]. You can expand rules as often as you want. They will always give you another random snippet.

Here is an example of a rule that expands the rule heister:

[origin]
At dawn, #heister# and #heister# got ready for the biggest heist in their lives.

Origin is the name of the default node that gets expanded first. You should always have an origin node in your file.

If the above is evaluated it will randomly pick two values for the two expansions and the result will be either combination of names. An example result is At dawn, Alice O'Rourke and Jimmy Tartufi got ready for the biggest heist in their lives. – but you don't have control over what names get picked and if you run the expansion again the names will be different.

Tags

With every new expansion of #heister# there will be yet a new heist crew member. That means that you can't easily tell a story where we learn what happened to Jimmy and Jimmy alone. In order to save who the heisters are, we use tags. Tags are labels for specific expansions that are used instead of expansions in later parts of your grammar:

[origin]
[crew1:#heister#][crew2:#heister#]#crew1# and #crew2# got ready to go but #crew2# was nervous.

Tags can contain a value or a group of values. Tags can appear inside #rules#. Tags are variable, they can be set any number of times but a new value will override the old.

Modifiers

Modifiers are a way to process the text once it is expanded. They take the result of an expansion and modify it. For example, you can use them to transform a word to lower case.

[origin]
The vehicle had #heistcrew.uppercase# printed in big letter printed on the side.

[heistcrew]
safecrackx
breakrs.biz
goldgetters

By adding .uppercase to the rule heistcrew, the resulting text is turned into upper case letters. This is an example of a modifier. More of those can be found below.

The above would evaluate to one of the following sentences:

The vehicle had SAFECRACKX printed in big letter printed on the side.
The vehicle had BREAKRS.BIZ printed in big letter printed on the side.
The vehicle had GOLDGETTERS printed in big letter printed on the side.

Mofifiers

Ephemerald supports the following modifiers:

  • .capitaliseAll, .capitalizeAll: All caps
  • .capitalize, .caps: Capitalise first letter
  • .title: Title case
  • .lowercase: All lowercase
  • .a: Put a/an before the word
  • .ed: Turn into simple past tense (not sophisticated)
  • .s: Turn word into its plural form
  • .n: Add a newline after the text

Running it in Unity or Making a Twitter Bot

You can directly use the grammars you wrote in Unity via the Ephemeral Unity Plugin.

Or upload the converted JSON (after pressing the CONVERT button) to Cheap Bots Done Quick and you have a Twitter bot.

Frequently Asked Questions

How do I save my files?
Just copy-paste your code into a text file and save it.

Can I contribute to this project?
You are most welcome to fork the code behind this project.

But this is just Tracery?
Yes it is. I only made the text format for humans first and machines second.