Ramus 2.5 guide

Please enable Javascript to play.

Ramus is a template for hypertext fiction or games self-contained in a single web page. Emphasis on template: to make your own, simply replace the content of an existing document. As long as certain elements are left in place, it should continue to function as before.

You need to know HTML to work with Ramus. It's not for everyone.

As of 3 June 2021, this guide is only intended to give you a quick overview.

Ramus documents are made of many little fragments, usually simple div elements. All they need to have is an ID, so you can point links at them. In Ramus 2.1, links had all the power.

That changed in version 2.2 with the addition of a little scripting language. In turn, it was upgraded in version 2.4 to a proper template system.

The only mandatody elements in a Ramus document are some sort of container with "transcript" as ID (you can change that, see below) and the script at the end. You'll also want a hidden section to keep the story fragments until they're needed. There should be at least one such fragment with "start" as ID (you can change that also, at the top of the script).

As of version 2.1, there's also an optional status line that can be used to keep track of progress if at all desirable. Last but not least, Ramus now keeps track of visited fragments.

The script is kept relatively short on purpose, and should be the last thing in the file, so you can copy it elsewhere easily. Feel free to customize it as needed.

The status line is in fact comprised of three separate elements, whose IDs are "status", "moves" and "score", respectively. They can be placed anywhere in the document, or even removed entirely. Here's how they work:

The status text is taken from the title element of each story fragment as it's visited, if one is present at all; otherwise it's not changed.

The move counter is incremented every time the player follows a link.

The score is incremented whenever the player visits a passage with the data-score attribute.

Scoring requires a relatively modern browser to work.

Ramus keeps track of which story fragments were already visited, and adds the "visited" or "unvisited" class to their containers as they are displayed. You can use styling to show or hide parts of them accordingly.

This feature requires a relatively modern browser to work; otherwise visits will still be noted, but without any visual changes.

Since version 2.4, Ramus includes a proper template system. It's based on Javascript expressions, to stay as simple as it gets. Here's a sample:

	#do a = 1
#literal	<p>a was set to {{a}}.
#literal	#test a === 1
#literal	#iftrue <p>Is too!
#literal	#iffalse <p>Is not!

For more details, see the scripting reference included separately.