This is an old revision of the document!
Links are the player's means of moving between passages and affecting the story. They are the equivalent of being told to turn to another page in a nonlinear book; in gamebooks, for example, you do this to make decisions for the main character. But this isn't the only possible kind of link. Deena Larsen describes a whole taxonomy of links in Fundamentals: A Rhetorical Devices for Electronic Literature.
Links are marked like so:
[[//displayed text//|//title of passage//]]
The two square brackets enclose the whole link, and the pipe symbol separates the displayed text from the passage title.
There is also a shorter form of the link syntax…
…where the displayed link text matches the title of the passage it links to.
If a story has a broken link in it, it is displayed with a red background in your story, and clicking it shows this message:
The passage 'The newspaper' doesn't exist.
You may also add links to external sites. These links look like this:
You may link to any address that a reader's web browser will understand.
When you develop more complex stories that use variables, it can be very useful to make certain variables be altered by the act of clicking a link. You can accomplish this by inserting an additional square bracket pair into the syntax like so:
[[displayed text|title of passage][$variable = expression]]
The 'code' portion of the link syntax is treated as if it was a <<set>> macro - consult that page to learn about the syntax to use. A link with a piece of code attached like this is called a setter link, and the attached code is called its tail.