On May 15, 2009, at 1:27 AM, Sergiu Dumitriu wrote:
Vladimir Konrad wrote:
Hello,
I did search what I possibly could but could not find a way to attach
an SVG file to a document and have this image rendered in it.
Is this doable?
I found that there is SVG plugin (enabled) in the xwiki.cfg but could
not find any documentation on how to use it.
(this is on XWiki 1.9-m2)
Check
http://code.xwiki.org/xwiki/bin/view/Macros/SVGMacro (this works
with documents in the xwiki/1.0 syntax).
If you want to do something similar in 2.0 syntax, you should use:
{{velocity}}
{{html}}<img
src="${xwiki.svg.getSVGImageURL($
{doc.getAttachment('logo.svg').getContentAsString()},
100, 100)}" width="100" height="100" alt="The logo"
/>{{/html}}
{{/velocity}}
Note that in the near future you'll be able to write:
{{velocity}}
[[image:${xwiki.svg.getSVGImageURL($
{doc.getAttachment('logo.svg').getContentAsString()}, 100,
100)}>>width="100" height="100" alt="The logo"]]
{{/velocity}}
And you'll also be able to create macros from wiki pages easily just
you'll be able to create your own {{svg}} macro. Of course we'll
probably just provide an svg macro in the default distribution... :)
Thanks
-Vincent