On Feb 13, 2009, at 7:26 PM, Ryan Lane wrote:
> I think I'm confused about what we are trying to accomplish here.
>
> Do we want to:
>
> 1. Be able to take a tag like:
>
> <graphviz renderer="dot">
> digraph G {
> node1->node2->node3
> }
> </graphviz>
>
> send it as:
>
> http://<servername>/w/index.php?title=Special%3AGraphviz&source=
> %3Cgraphviz%20renderer%3D%22dot%22%3Edigraph%20G%20%7Bnode1-%3Enode2-
> %3Enode3%7D%3C/graphviz%3E&attr=dot
>
> and have a filename returned as:
>
> http://<servername>/w/images/graphviz/
> 233b20134c14f65a896fbfe01f0021d2.png
>
> or:
>
> 2. On the client side, take md5(source).png
> (233b20134c14f65a896fbfe01f0021d2.png), return this to the parse tree
> as:
>
> [[Image:<<Special:Graphviz>>/233b20134c14f65a896fbfe01f0021d2.png]]
>
> make the following request:
>
> http://<servername>/w/index.php?title=Special
> %3AGraphviz&filename=233b20134c14f65a896fbfe01f0021d2.png
>
> and have the server return an image?
>
> V/r,
>
First of all we probably will have to hack the handling of the
[[Image:]] construct to support external links:
http://meta.wikimedia.org/wiki/Help:Images_and_other_uploaded_files#Link
we currently don't if I got the source right:
http://code.pediapress.com/hg/mwlib/file/71009b0f6bc2/mwlib/mwapidb.py#l392
( note to self: what about the involved attribution issues?)
It then depends, whether 15K is enough for most of the graphviz
descriptions and can be handled by the majority of servers, PHP and
MediaWiki deployments.
If so, construct an URL like the 1st one in your example 1), put it
into an image construct [[Image:Pic.jpg|link=<your url>]], return this
from your function in tagext.py and patch the extension to directly
return an image from this URLs location based on the parametrized data.
If there are problems with the 15K limit, hash the graphviz-
description, construct an URL like the second one in your example 1)
put it into an image construct [[Image:Pic.jpg|link=<your url>]],
return this from your function in tagext.py and patch the extension to
directly return an image from this URLs location based on the
parametrized data. In this case you'll probably depend on a cached
version of this image. Also there obviously needs to be a consistent
mapping of the graphviz description and the md5 hash. You could
implement this approach as a fallback if the former exceeds the GET
size limit.
Heiko
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"mwlib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/mwlib?hl=en
-~----------~----~----~----~------~----~------~--~---