| Chapter 21: Extensions |

| 21.9. Extension documentation

A basic mechanism for documenting extensions is built into Inform. For many extensions, this will probably do instead of a manual; for more complex ones, it should still prove a useful supplement to one.

As described in Chapter 2 above, whenever an extension is used, whatever documentation it provides is also added to the main Inform documentation. Such text should be written concisely, while giving examples wherever appropriate. Stylistically, it should ideally follow the model of the main Inform documentation: just as an extension expands the standard rules, so its documentation expands this manual. "We need..." is preferred to "You need...", and so on: we're all in this together.

In order to be recognised as documentation, this text should appear at the foot of the extension file, after the compulsory end sentence. The first paragraph must have exactly the following form, with a skipped line before and after:

> ---- DOCUMENTATION ----

For instance, the "Ducking Action" example might end:

> ...
> The Ducking Action ends here.

> ---- DOCUMENTATION ----

> This is a modest extension, with much to be modest about. It allows us to use a new action for ducking, as in ducking the player's head (not as in ducking a witch). Ducking will do nothing unless rules are added:

> Instead of ducking in the Shooting Gallery, say "Too late!"

> ...

We obtain indented code examples by beginning a line with a tab. A double indentation can be got with two tabs in a row, and so forth. (Beware: some text editors, or emailers, flatten tabs into a row of four or perhaps eight spaces each. Inform will not recognise such a line of spaces as a tab.)

Tables should be similarly indented, and should begin with the word "Table ...": the top line is taken to be the name of the table, and subsequent lines are tab-divided columns. Inform will automatically group this into a table, like so:

> Table of Exemplariness

> stellar object | example
> galaxy | "Andromeda Galaxy M31"
> star | "Sirius"
> planet | "Neptune"
> moon | "Enceladus"
> asteroid | "Ceres"

Previous | Contents | Next