1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-09 10:34:22 +03:00
inform7/docs/inrtps/P-ui.html
2020-03-19 00:11:25 +00:00

142 lines
5.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Booklet Title</title>
<meta name="viewport" content="width=device-width initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-gb">
<link href="../inweb.css" rel="stylesheet" rev="stylesheet" type="text/css">
</head>
<body>
<nav role="navigation">
<h1><a href="../webs.html">Sources</a></h1>
<ul>
<li><a href="../compiler.html">compiler</a></li>
<li><a href="../other.html"><b>other tools</b></a></li>
<li><a href="../extensions.html">extensions and kits</a></li>
<li><a href="../units.html">unit test tools</a></li>
</ul>
<h2>Other Tools</h2>
<ul>
<li><a href="../inblorb/index.html">inblorb</a></li>
<li><a href="../indoc/index.html">indoc</a></li>
<li><a href="../inpolicy/index.html">inpolicy</a></li>
<li><a href="../inrtps/index.html">inrtps</a></li>
</ul>
<h2>Foundation</h2>
<ul>
<li><a href="../../../inweb/docs/foundation-module/index.html">foundation</a></li>
</ul>
</nav>
<main role="main">
<!--Weave of 'P/ui' generated by 7-->
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="../other.html">Other Tools</a></li><li><a href="index.html">inrtps 2</a></li><li><a href="index.html#P">Preliminaries</a></li><li><b>Using Inrtps</b></li></ul><p class="purpose">A brief user guide.</p>
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;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>
<p class="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>
<p class="inwebparagraph"></p>
<pre class="display">
<span class="plain">*** Run-time problem P17: You can't divide by zero.</span>
</pre>
<p class="inwebparagraph">(<code class="display"><span class="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>
<p class="inwebparagraph"></p>
<pre class="display">
<span class="plain">RTP_P17.html</span>
</pre>
<p class="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>
<p class="inwebparagraph"><a id="SP2"></a><b>&#167;2. </b>If you have compiled the standard distribution of the command-line tools
for Inform then the Inrtps executable will be at <code class="display"><span class="extract">inrtps/Tangled/inrtps</span></code>.
Usage is very simple:
</p>
<p class="inwebparagraph"></p>
<pre class="display">
<span class="plain">$ inrtps/Tangled/inrtps FROM TO [OPTIONS]</span>
</pre>
<p class="inwebparagraph">The first two arguments are names of folders. The only useful option
is <code class="display"><span class="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>
<p class="inwebparagraph">Inpolicy can be run from anywhere in the file system and does not need
to know where it's installed.
</p>
<p class="inwebparagraph"><a id="SP3"></a><b>&#167;3. </b>The <code class="display"><span class="extract">FROM</span></code> folder is expected to contain two files:
</p>
<p class="inwebparagraph"></p>
<pre class="display">
<span class="plain">FROM/model.html</span>
<span class="plain">FROM/texts.txt</span>
</pre>
<p class="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>
<p class="inwebparagraph"></p>
<pre class="display">
<span class="plain">P17 - Can't divide by zero</span>
<span class="plain">A number cannot be divided by 0: similarly, we cannot take the remainder</span>
<span class="plain">after dividing something by 0.</span>
</pre>
<p class="inwebparagraph">The model file is a standard HTML file, except that it can contain four
escape codes, which Inrtps expands. Thus:
</p>
<p class="inwebparagraph"></p>
<ul class="items"><li>(a) <code class="display"><span class="extract">*1</span></code> expands to the code number of the message.
</li><li>(b) <code class="display"><span class="extract">*2</span></code> expands to the full textual explanation.
</li><li>(c) <code class="display"><span class="extract">*3</span></code> expands to a short title for the message.
</li><li>(d) <code class="display"><span class="extract">*4</span></code> expands to font settings inside a <code class="display"><span class="extract">&lt;font ...&gt;</span></code> tag. (This will be
blank if <code class="display"><span class="extract">nofont</span></code> is set, or will choose a Helvetica-like font if <code class="display"><span class="extract">font</span></code> is set.)
</li></ul>
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Preliminaries.)</i></li><li><i>(This section ends Preliminaries.)</i></li></ul><hr class="tocbar">
<!--End of weave-->
</main>
</body>
</html>