mirror of
https://github.com/ganelson/inform.git
synced 2024-07-16 22:14:23 +03:00
138 lines
7.5 KiB
HTML
138 lines
7.5 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<title>Using Inrtps</title>
|
|
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<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="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
<link href="../docs-assets/ConsoleText-Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
|
|
|
</head>
|
|
<body class="commentary-font">
|
|
<nav role="navigation">
|
|
<h1><a href="../index.html">
|
|
<img src="../docs-assets/Inform.png" height=72">
|
|
</a></h1>
|
|
<ul><li><a href="../index.html">home</a></li>
|
|
</ul><h2>Compiler</h2><ul>
|
|
<li><a href="../structure.html">structure</a></li>
|
|
<li><a href="../inbuildn.html">inbuild</a></li>
|
|
<li><a href="../inform7n.html">inform7</a></li>
|
|
<li><a href="../intern.html">inter</a></li>
|
|
<li><a href="../services.html">services</a></li>
|
|
<li><a href="../secrets.html">secrets</a></li>
|
|
</ul><h2>Other Tools</h2><ul>
|
|
<li><a href="../inblorbn.html">inblorb</a></li>
|
|
<li><a href="../indocn.html">indoc</a></li>
|
|
<li><a href="../inform6.html">inform6</a></li>
|
|
<li><a href="../inpolicyn.html">inpolicy</a></li>
|
|
<li><a href="../inrtpsn.html">inrtps</a></li>
|
|
</ul><h2>Resources</h2><ul>
|
|
<li><a href="../extensions.html">extensions</a></li>
|
|
<li><a href="../kits.html">kits</a></li>
|
|
</ul><h2>Repository</h2><ul>
|
|
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=18> github</a></li>
|
|
</ul><h2>Related Projects</h2><ul>
|
|
<li><a href="../../../inweb/index.html">inweb</a></li>
|
|
<li><a href="../../../intest/index.html">intest</a></li>
|
|
|
|
</ul>
|
|
</nav>
|
|
<main role="main">
|
|
<!--Weave of 'Using Inrtps' generated by Inweb-->
|
|
<div class="breadcrumbs">
|
|
<ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="index.html">inrtps</a></li><li><a href="index.html#M">Manual</a></li><li><b>Using Inrtps</b></li></ul></div>
|
|
<p class="purpose">A brief user guide.</p>
|
|
|
|
<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></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>
|
|
|
|
<p class="commentary">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>
|
|
|
|
<pre class="displayed-code all-displayed-code code-font">
|
|
<span class="plain-syntax"> *** Run-time problem P17: You can't divide by zero.</span>
|
|
</pre>
|
|
<p class="commentary">(<span class="extract"><span class="extract-syntax">P17</span></span> 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>
|
|
|
|
<pre class="displayed-code all-displayed-code code-font">
|
|
<span class="plain-syntax"> RTP_P17.html</span>
|
|
</pre>
|
|
<p class="commentary">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="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></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 <span class="extract"><span class="extract-syntax">inrtps/Tangled/inrtps</span></span>.
|
|
Usage is very simple:
|
|
</p>
|
|
|
|
<pre class="ConsoleText-displayed-code all-displayed-code code-font">
|
|
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inrtps/Tangled/inrtps</span><span class="ConsoleText-plain-syntax"> FROM TO [OPTIONS]</span>
|
|
</pre>
|
|
<p class="commentary">The first two arguments are names of folders. The only useful option
|
|
is <span class="extract"><span class="ConsoleText-extract-syntax">-font</span></span>, 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="commentary">Inpolicy can be run from anywhere in the file system and does not need
|
|
to know where it's installed.
|
|
</p>
|
|
|
|
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>§3. </b>The <span class="extract"><span class="ConsoleText-extract-syntax">FROM</span></span> folder is expected to contain two files:
|
|
</p>
|
|
|
|
<pre class="displayed-code all-displayed-code code-font">
|
|
<span class="plain-syntax"> FROM/model.html</span>
|
|
<span class="plain-syntax"> FROM/texts.txt</span>
|
|
</pre>
|
|
<p class="commentary">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>
|
|
|
|
<pre class="displayed-code all-displayed-code code-font">
|
|
<span class="plain-syntax"> P17 - Can't divide by zero</span>
|
|
<span class="plain-syntax"> A number cannot be divided by 0: similarly, we cannot take the remainder</span>
|
|
<span class="plain-syntax"> after dividing something by 0.</span>
|
|
</pre>
|
|
<p class="commentary">The model file is a standard HTML file, except that it can contain four
|
|
escape codes, which Inrtps expands. Thus:
|
|
</p>
|
|
|
|
<ul class="items"><li>(a) <span class="extract"><span class="extract-syntax">*1</span></span> expands to the code number of the message.
|
|
</li><li>(b) <span class="extract"><span class="extract-syntax">*2</span></span> expands to the full textual explanation.
|
|
</li><li>(c) <span class="extract"><span class="extract-syntax">*3</span></span> expands to a short title for the message.
|
|
</li><li>(d) <span class="extract"><span class="extract-syntax">*4</span></span> expands to font settings inside a <span class="extract"><span class="extract-syntax"><font ...></span></span> tag. (This will be
|
|
blank if <span class="extract"><span class="extract-syntax">nofont</span></span> is set, or will choose a Helvetica-like font if <span class="extract"><span class="extract-syntax">font</span></span> is set.)
|
|
</li></ul>
|
|
<nav role="progress"><div class="progresscontainer">
|
|
<ul class="progressbar"><li class="progressprevoff">❮</li><li class="progresscurrentchapter">M</li><li class="progresscurrent">ui</li><li class="progresssection"><a href="M-rc.html">rc</a></li><li class="progresschapter"><a href="1-mn.html">1</a></li><li class="progressnext"><a href="M-rc.html">❯</a></li></ul></div>
|
|
</nav><!--End of weave-->
|
|
|
|
</main>
|
|
</body>
|
|
</html>
|
|
|