<ulclass="crumbs"><li><ahref="../webs.html">★</a></li><li><ahref="index.html">inrtps 2</a></li><li><ahref="index.html#P">Preliminaries</a></li><li><b>Using Inrtps</b></li></ul><pclass="purpose">A brief user guide.</p>
<pclass="inwebparagraph"><aid="SP1"></a><b>§1. </b>Inrtps is a one-trick pony: its trick is to turn simple textual messages
into HTML pages suitable for display inside the Inform user interface
application. These are used mainly for run-time problems, which are
the RTPs included in the name.
</p>
<pclass="inwebparagraph">A run-time problem occurs, for instance, if a story file generated by Inform
tries to divide by 0. The story file will then print up a run-time problem
message of a very concise kind, like so:
</p>
<pclass="inwebparagraph"></p>
<preclass="display">
<spanclass="plain">*** Run-time problem P17: You can't divide by zero.</span>
</pre>
<pclass="inwebparagraph">(<codeclass="display"><spanclass="extract">P17</span></code> is the "code number" for the message.) If the story file is
running in a typical interpreter, that will be the end of the matter, but
if it runs in the Inform application's built-in interpreter then the
appearance of such text will be noticed and will cause Inform to open a
suitably explanatory page in the panel alongside Game. This will be an HTML
page called
</p>
<pclass="inwebparagraph"></p>
<preclass="display">
<spanclass="plain">RTP_P17.html</span>
</pre>
<pclass="inwebparagraph">kept in a folder somewhere inside the application. Clearly there will be
a fair number of possible errors, and we don't want to have to build these
HTML pages by hand. Inrtps automates their generation.
</p>
<pclass="inwebparagraph"><aid="SP2"></a><b>§2. </b>If you have compiled the standard distribution of the command-line tools
for Inform then the Inrtps executable will be at <codeclass="display"><spanclass="extract">inrtps/Tangled/inrtps</span></code>.
Usage is very simple:
</p>
<pclass="inwebparagraph"></p>
<preclass="display">
<spanclass="plain">$ inrtps/Tangled/inrtps FROM TO [OPTIONS]</span>
</pre>
<pclass="inwebparagraph">The first two arguments are names of folders. The only useful option
is <codeclass="display"><spanclass="extract">-font</span></code>, which can be used to force an avoidance of CSS (see below).
At present this is used only on the Windows build of Inform.
</p>
<pclass="inwebparagraph">Inpolicy can be run from anywhere in the file system and does not need
to know where it's installed.
</p>
<pclass="inwebparagraph"><aid="SP3"></a><b>§3. </b>The <codeclass="display"><spanclass="extract">FROM</span></code> folder is expected to contain two files:
</p>
<pclass="inwebparagraph"></p>
<preclass="display">
<spanclass="plain">FROM/model.html</span>
<spanclass="plain">FROM/texts.txt</span>
</pre>
<pclass="inwebparagraph">The texts file is a plain text file explaining each RTP in turn. The first
line of an RTP has a special format identifying it: the remaining lines
give the explanation, and a skipped (i.e., blank) line divides each RTP
from the next. For instance:
</p>
<pclass="inwebparagraph"></p>
<preclass="display">
<spanclass="plain">P17 - Can't divide by zero</span>
<spanclass="plain">A number cannot be divided by 0: similarly, we cannot take the remainder</span>
<spanclass="plain">after dividing something by 0.</span>
</pre>
<pclass="inwebparagraph">The model file is a standard HTML file, except that it can contain four
escape codes, which Inrtps expands. Thus:
</p>
<pclass="inwebparagraph"></p>
<ulclass="items"><li>(a) <codeclass="display"><spanclass="extract">*1</span></code> expands to the code number of the message.
</li><li>(b) <codeclass="display"><spanclass="extract">*2</span></code> expands to the full textual explanation.
</li><li>(c) <codeclass="display"><spanclass="extract">*3</span></code> expands to a short title for the message.
</li><li>(d) <codeclass="display"><spanclass="extract">*4</span></code> expands to font settings inside a <codeclass="display"><spanclass="extract"><font ...></span></code> tag. (This will be
blank if <codeclass="display"><spanclass="extract">nofont</span></code> is set, or will choose a Helvetica-like font if <codeclass="display"><spanclass="extract">font</span></code> is set.)