Hi,
This drove me nuts for a while, but I found a solution. In case anyone else wants to add
SVG images the help section here is a workaround:
Apparently reStructuredText is part of a package called Docutils. The current
"stable" version of Docutils does not support SVG images. SVGs need to be placed
in an <object> tag, but Docutils generates HTML with the svg in an <image>
tag. This is fixed in the development version. If you don't want the unstable version,
you can use something like the code below to insert raw html code into the help section.
Note that the examples for inserting raw html in the Docutils documentation are not
correct: you'll need to encode the < and > characters.
-----------------------------------
.. role:: raw-html(raw)
:format: html
.. class:: infomark
**What it does**
Some help on how to use this great tool.
:raw-html:`<object data="/images/custom_galaxy_tools/myTool.svg"
type="image/svg+xml" width="100%"/>`
Some more help on how to use his tool
-----------------------------------
Also note that the raw-html role must be at the beginning of the reStructuredText
preceding any other directives.
Cheers,
Pi
On Apr 13, 2010, at 11:22 AM, Pieter Neerincx wrote:
Hi,
I have some tools that produce SVG images. These load just fine in a browser when they
are in the middle part of a galaxy browser window as tool output. But now I've added
some example images as documentation in the help section of the *.xml tool config files
using the reStructuredText syntax like this:
.. image:: /images/custom_galaxy_tools/ExtractModificationSiteSequenceContext.svg
The problem is that these images don't load. Instead the text above is displayed. The
strange thing is that you cannot select the text, but if I right-click on it, I get a
contextual menu with the options "View Image", "Copy Image", etc. So
it seems the files are recognized as images. Bitmap images in file formats like PNG do
load directly. Does anyone on the list know what I need to do to make SVGs load directly
too?
Cheers,
Pi
---------------------------------------------------------------
Biomolecular Mass Spectrometry & Proteomics group
Utrecht University
Visiting address:
H.R. Kruyt building room O607
Padualaan 8
3584 CH Utrecht
The Netherlands
Mail address:
P.O. box 80.082
3508 TB Utrecht
The Netherlands
phone: +31 6 143 66 783
email: pieter.neerincx(a)gmail.com
skype: pieter.online
---------------------------------------------------------------
-------------------------------------------------------------
mobile: +31 6 143 66 783
e-mail: pieter.neerincx(a)gmail.com
skype: pieter.online
-------------------------------------------------------------