r3 - 14 Nov 2005 - 23:13:03 - RickMachYou are here: TWiki >  Plugins Web > SvgPlugin
Tags:
graphing 1 Add my vote for this tag, visualization 1 Add my vote for this tag, , create new tag

SvgPlugin

SvgPlugin displays SVG drawings attached in TWiki as PNG images, inline in your topics.

SvgPlugin uses the Image::LibRSVG Perl module (which uses librsvg), to convert your SVG drawings into PNG pictures.

Syntax Rules

  • %SVG{"drawing" parameters}%
    • where drawing is the filename of an attached SVG image.
  • Parameters:
    Parameter Description Defaul value
    size the maximum size of the picture. The picture will be generated do fit in this size. SvgPlugin will generate a picture the fits best in the given size, without distorting the image. DEFAULTSIZE setting below
    topic The topic to which the drawing is attached. Can be TheTopic or Web.TheTopic current topic

Examples

You type: You should get: You get (if installed):
%SVG{"TWikiBrasil.svg"}% TWikiBrasil-320x200.png %SVG{"TWikiBrasil.svg"}%
%SVG{"TWikiBrasil.svg" size="400x300"}% TWikiBrasil-400x300.png %SVG{"TWikiBrasil.svg" size="400x300"}%
%SVG{}% SvgPlugin: you must specify a drawing to display! %SVG{}%
%SVG{"TWikiBrasil.svg" topic="Main.AntonioTerceiro"}% SvgPlugin: can't find drawing TWikiBrasil.svg attched at Main/AntonioTerceiro. %SVG{"TWikiBrasil.svg" topic="Main.AntonioTerceiro"}%

Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %INTERWIKIPLUGIN_SHORTDESCRIPTION%

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Shows SVG drawings as PNG pictures embeded in topics

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 1

  • My own setting:
    • Set DEFAULTSIZE = 320x200

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

  • Install the Image::LibRSVG Perl module.
  • Download the ZIP file from the Plugin web (see below)
  • Unzip SvgPlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/SvgPlugin.txt Plugin topic
    data/TWiki/SvgPlugin.txt,v Plugin topic repository
    lib/TWiki/Plugins/SvgPlugin.pm Plugin Perl module
    pub/TWiki/SvgPlugin/TWikiBrasil.svg Sample drawing
    pub/TWiki/SvgPlugin/TWikiBrasil-320-200.png Sample picture
    pub/TWiki/SvgPlugin/TWikiBrasil-400x300.png Sample picture
  • Test if the installation was successful:
    • see examples above.

Plugin Info

Plugin Author: TWiki:Main/AntonioTerceiro
Plugin Version: 05 Oct 2004 (V1.000)
Change History:  
05 Oct 2004: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.000
CPAN Dependencies: Image::LibRSVG
Other Dependencies: librsvg headers, if needed to compile Image::LibRSVG, and librsvg
Perl Version: tested with 5.8.4
TWiki:Plugins/Benchmark: GoodStyle nn%, FormattedSearch nn%, SvgPlugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/SvgPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/SvgPluginDev

Related Topics: TWikiPreferences, TWikiPlugins

-- TWiki:Main/AntonioTerceiro - 06 Oct 2004

Topic attachments
I Attachment Action Size Date Who Comment
zipzip SvgPlugin.zip manage 35.2 K 06 Oct 2004 - 22:04 AntonioTerceiro SvgPlugin package
elsesvg TWikiBrasil.svg manage 17.0 K 06 Oct 2004 - 22:05 AntonioTerceiro TWikiBrasil logo, by TWiki:Main/AurelioAHeckert
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo