Once we have constructed a fine quantlet, we are interested in other people using it. This is done by publishing the quantlet technology via an HTML file. Other students and scientists may use the quantlet then inside the XploRe Auto Pilot Support System (APSS), see Figure 17.5.
We are now ready to publish our first
quantlet with the tools that are available in
XploRe
. First we define
where the HTML file should be written. We do this
via the
setenv
command by setting the APSS
output stream to go into the directory C:
\
XploRe
setenv("xpl4outhelp","C:\XploRe")We may check the effect of this command by clicking the Main item and then the Info item. We see that the output stream is set to the desired directory.
In the next step it is necessary to provide all information which will
be contained in the resulting HTML file. This is done very easily by
including the following header directly in the source code of our quantlet.
A template of the header is inserted automatically via the
Insert help item in the Tools menu and you can fill in
all the desired information. You should do this
very carefully in order
to allow other users to run your quantlet comfortably.
Typically, it starts immediately after the
proc
statement.
Recall our first quantlet myquant from Section 17.1. The beginning of the quantlet myquant.xpl should look like this:
proc() = myquant(obs1) ; -------------------------------------------------------- ; Library stats ; -------------------------------------------------------- ; See_also linreg ; -------------------------------------------------------- ; Macro myquant ; -------------------------------------------------------- ; Description plot of the effect of outliers in linear ; regression model ; -------------------------------------------------------- ; Usage myquant(obs1) ; Input ; Parameter obs1 ; Definition 2x1 vector - coordinates of an outlier ; Output ; Parameter ; Definition ; -------------------------------------------------------- ; Notes works fine ; -------------------------------------------------------- ; Example myquant(#(10,45)) ; -------------------------------------------------------- ; Result produces a plot of true regression line and ; the regression line ; -------------------------------------------------------- ; Keywords myquant ; -------------------------------------------------------- ; Reference lecture notes, XploRe manual ; -------------------------------------------------------- ; Link ; -------------------------------------------------------- ; Author anonymous ;--------------------------------------------------------- n = 10
Now you are ready to create the HTML help file with the
makehelp
command
makehelp("html","C:\XploRe\myquant.xpl")This command automatically creates an HTML help file myquant.xpl in directory C:
\
XploRe which was beforehand specified
as the output directory for the help file by the command
The first argument of
makehelp
specifies which type of help file
will be created.
Possible choices are "html" for HTML help file, "ascii"
for ascii help file and "latex" for manual page. The second argument
specifies the
XploRe
program for which the help file will be created.
You do not have to restrict yourself to generating only one help file. You can easily create the complete APSS (Auto Pilot Support System). The command
makehelp("html","C:\XploRe")generates the complete help system from the files in directories C:
\
XploRe\
hlp2 and
C:\
XploRe\
lib and writes the resulting
files in C:\
XploRe\
help and
C:\
XploRe\
help\
text directories.
Before you call this command, you should check whether these
directories exist and whether you have permission to write into them.