So eventually I tried this and indeed it works as expected. I have one more
question though.
I've seen that most of the complex math formulas are converted into .png
images with some long names - for instance, the <math>\iiiint\limits_F \,
dx\,dy\,dz\,dt</math> formula (triple integral) is converted into an image
with the name 49005f50f3ba2dfade3a265ebe363ee9.png. I'd like to know, is
this file name unique for each formula ? And is it persisted on the wiki's
server indefinitely, just like other images in articles ? To be more clear,
is the triple integral formula always going to be associated to this
49005f50f3ba2dfade3a265ebe363ee9.png
file ?
I'm trying to implement a cache mechanism in my app that tries to also deal
with images generated from math markup (besides usual images in articles),
that's why I have this curiosity. I'd like to know if I can safely associate
a math markup string with a file name so that there's no need to retrieve
the image from the server again when I encounter that formula.
On Mon, Dec 13, 2010 at 1:23 PM, Roan Kattouw <roan.kattouw(a)gmail.com>wrote;wrote:
2010/12/13 Gabriel Sandor
<gabi.t.sandor(a)gmail.com>om>:
Is it possible to retrieve (preferably via the
MediaWiki API) an image
representing a mathematical formula given in the <math> tags that are
frequently encountered in Wikipedia articles ?
There's no direct way to do
this, although I guess it could be
implemented. A workaround would be to do something like
http://en.wikipedia.org/w/api.php?action=parse&text=
<math>\gamma=\frac{1}{\sqrt{1-v^2}}</math>&format=yamlfm
, which will give you the HTML generated for this <math> tag, which
could be an image (like in this case), or HTML if the formula is
sufficiently simple (try a^2+b^2=c^2 for instance).
Roan Kattouw (Catrope)
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api