2019-03-17 14:40:57 +02:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
< html >
< head >
2020-04-14 19:56:54 +03:00
< title > Using Inrtps< / title >
2020-05-03 03:20:55 +03:00
< link href = "../docs-assets/Breadcrumbs.css" rel = "stylesheet" rev = "stylesheet" type = "text/css" >
2020-03-19 02:11:25 +02:00
< meta name = "viewport" content = "width=device-width initial-scale=1" >
2019-03-17 14:40:57 +02:00
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" >
< meta http-equiv = "Content-Language" content = "en-gb" >
2020-05-03 03:01:21 +03:00
2020-05-03 03:20:55 +03:00
< 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" >
2020-04-14 19:56:54 +03:00
2019-03-17 14:40:57 +02:00
< / head >
2020-05-03 03:01:21 +03:00
< body class = "commentary-font" >
2020-03-19 02:11:25 +02:00
< nav role = "navigation" >
2020-04-14 19:56:54 +03:00
< h1 > < a href = "../index.html" >
2020-05-03 18:34:53 +03:00
< img src = "../docs-assets/Inform.png" height = 72" >
2020-04-14 19:56:54 +03:00
< / a > < / h1 >
< ul > < li > < a href = "../compiler.html" > compiler tools< / a > < / li >
< li > < a href = "../other.html" > other tools< / a > < / li >
2020-03-19 02:11:25 +02:00
< li > < a href = "../extensions.html" > extensions and kits< / a > < / li >
< li > < a href = "../units.html" > unit test tools< / a > < / li >
2020-04-14 19:56:54 +03:00
< / ul > < h2 > Other Tools< / h2 > < ul >
2020-03-19 02:11:25 +02:00
< 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 >
2020-04-14 19:56:54 +03:00
< li > < a href = "index.html" > < span class = "selectedlink" > inrtps< / span > < / a > < / li >
< / ul > < h2 > Foundation< / h2 > < ul >
2020-03-19 02:11:25 +02:00
< li > < a href = "../../../inweb/docs/foundation-module/index.html" > foundation< / a > < / li >
2020-04-14 19:56:54 +03:00
< / ul >
2020-03-19 02:11:25 +02:00
< / nav >
< main role = "main" >
2020-05-03 03:01:21 +03:00
<!-- Weave of 'Using Inrtps' generated by Inweb -->
< div class = "breadcrumbs" >
< ul class = "crumbs" > < li > < a href = "../index.html" > Home< / a > < / li > < li > < a href = "../other.html" > Other Tools< / 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 >
2019-03-17 14:40:57 +02:00
2020-08-27 17:50:24 +03:00
< 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
2019-03-17 14:40:57 +02:00
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 >
2020-05-03 03:01:21 +03:00
< p class = "commentary" > A run-time problem occurs, for instance, if a story file generated by Inform
2019-03-17 14:40:57 +02:00
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 >
2020-05-03 03:01:21 +03:00
< pre class = "displayed-code all-displayed-code code-font" >
< span class = "plain-syntax" > *** Run-time problem P17: You can't divide by zero.< / span >
2019-03-17 14:40:57 +02:00
< / pre >
2020-05-03 03:01:21 +03:00
< 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
2019-03-17 14:40:57 +02:00
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 >
2020-05-03 03:01:21 +03:00
< pre class = "displayed-code all-displayed-code code-font" >
< span class = "plain-syntax" > RTP_P17.html< / span >
2019-03-17 14:40:57 +02:00
< / pre >
2020-05-03 03:01:21 +03:00
< p class = "commentary" > kept in a folder somewhere inside the application. Clearly there will be
2019-03-17 14:40:57 +02:00
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 >
2020-08-27 17:50:24 +03:00
< 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
2020-05-03 03:01:21 +03:00
for Inform then the Inrtps executable will be at < span class = "extract" > < span class = "extract-syntax" > inrtps/Tangled/inrtps< / span > < / span > .
2019-03-17 14:40:57 +02:00
Usage is very simple:
< / p >
2020-05-03 03:01:21 +03:00
< 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 >
2019-03-17 14:40:57 +02:00
< / pre >
2020-05-03 03:01:21 +03:00
< 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).
2019-03-17 14:40:57 +02:00
At present this is used only on the Windows build of Inform.
< / p >
2020-05-03 03:01:21 +03:00
< p class = "commentary" > Inpolicy can be run from anywhere in the file system and does not need
2019-03-17 14:40:57 +02:00
to know where it's installed.
< / p >
2020-08-27 17:50:24 +03:00
< 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:
2019-03-17 14:40:57 +02:00
< / p >
2020-05-03 03:01:21 +03:00
< 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 >
2019-03-17 14:40:57 +02:00
< / pre >
2020-05-03 03:01:21 +03:00
< p class = "commentary" > The texts file is a plain text file explaining each RTP in turn. The first
2019-03-17 14:40:57 +02:00
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 >
2020-05-03 03:01:21 +03:00
< 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 >
2019-03-17 14:40:57 +02:00
< / pre >
2020-05-03 03:01:21 +03:00
< p class = "commentary" > The model file is a standard HTML file, except that it can contain four
2019-03-17 14:40:57 +02:00
escape codes, which Inrtps expands. Thus:
< / p >
2020-05-03 03:01:21 +03:00
< 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.)
2019-03-17 14:40:57 +02:00
< / li > < / ul >
2020-05-03 03:01:21 +03:00
< 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 -->
2020-03-19 02:11:25 +02:00
< / main >
2019-03-17 14:40:57 +02:00
< / body >
< / html >