Ramus 2.2 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 20 April 2020, 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, that also hijacks standard HTML elements (and also with the option of leaving them alone if you say so).

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.

As of version 2.2, Ramus includes a little scripting language. It's kind of clunky and doesn't have a name yet. The goal was to make something easy to use while keeping Ramus not too large. Here's a small sample:


	<s>set a 1</s> <s>echo $a</s>
	<s>test $a = 1</s>
		<s>iftrue echo Is too!</s>
		<s>iffalse echo Is not!</s>

For more details, see the scripting reference included separately. Scripts should work in any browser released from 2011 onward.