[Mediawiki-l] Extension with some page-dependent data

Gábor Csárdi Gabor.Csardi at unil.ch
Wed Aug 26 12:43:06 UTC 2009


Dear All,

I'm writing a MW extension that runs R (www.r-project.org) code and
displays the results. More precisely, the code is run by another
program on another machine, the extension only passes the code to it,
receives the results, formats and displays them.

I defined a custom tag for this, everything between <rcode>...</rcode>
is evaluated as R code. So far so good. Now, what I would like to do
is having a single R session for the whole page, instead of creating
an R session for every <rcode> tag. Where should I store the extra
data for the R session? Optimally, the first <rcode> tag on the page
would create the R session, store it, and the rest of the <rcode> tags
would just use it. Then, when the page was rendered (or there was an
error), the R session would be closed, its associated data deleted.

I am sure that there is a good solution for this, as it is a quite
general problem. If you can point me to some extension that uses a
similar technique, that is also fine.

Thanks a lot,
Gabor

-- 
Gabor Csardi <Gabor.Csardi at unil.ch>     UNIL DGM



More information about the MediaWiki-l mailing list