[Mediawiki-l] Using dynamically generated images using cgi

Jean-Marc van Leerdam j.m.van.leerdam at gmail.com
Mon Sep 14 10:33:00 UTC 2009


Hi,

2009/9/14 Max <virtual.maxime at gmail.com>:
> Hello everyone !
>
> I wrote some python scripts outputting images (svg format - I'm using
> matplotlib).
> My mediawiki is running on a closed intranet at this url :
> http://wiki/mediawiki/index.php
> I can show my image at this url : http://wiki/cgi-bin/my_script.py
>
> So, I wonder how to show this image on a page of the wiki (assuming
> that I'm a random registered user of the site, that I'm editing some
> page and that I know the name of the script).
>
> Obviously I can't upload the image -> [[Image:my_script.py]] won't
> work (as far as I know)
>
> Using an external link works : [http://wiki/cgi-bin/my_script.py] but
> I don't like to use an hard-coded url as the website url is subject to
> change.

That can be solved by setting up support for inter-wiki links. You
define a new interwiki name (like 'genimg') and add the appropriate
URL and parameter setting (http://wiki/cgi-bin/$1) to the interwiki
table. Links can then be entered like [[genimg:my_script.py]].

> (little question : I'm just seeing the link and not the image, does
> someone remember the option to set in order to see externally linked
> images ?)
>

Not sure, but maybe this can then be achieved by enabling inter-wiki
transclusion.

> Finally, Is there any other smarter way to do this ?
>

Probably, but then the real experts need to answer you ;-)

-- 
Regards,

Jean-Marc
--
.       ___
.  @@  // \\      "De Chelonian Mobile"
. (_,\/ \_/ \     TortoiseSVN
.   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
.   /_/   \_\     http://tortoisesvn.net



More information about the MediaWiki-l mailing list