This is an old revision of the document!
Table of Contents
svg pureinsert plugin
Compatible with DokuWiki
DokuWiki-2007-06-26b
Inserts a non PNG or otherwise modified SVG file, just its clean version. Plugin should work - mostly tested on SVGs from http://www.openclipart.org/ and Inkscape output. Any comments - place for them below.
The missing download url means that this extension cannot be installed via the Extension Manager. Please see Publishing a Plugin on dokuwiki.org. Recommended are public repository hosts like GitHub, GitLab or Bitbucket.
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Extension name contains underscore, will not generate popularity points.
Download
Here you can download plugin (supports remote installation): http://student.agh.edu.pl/~lechup/svg_pureInsert/svgpureInsert.zip
Installation
Do normal remote installation (ctrl+c → ctrl+v upper link in admin/manage plugins section of your DokuWiki)
Or manually after downloading plugin extract it and copy all the files to your DokuWiki /lib/plugins/ folder.
To enable the “media” support edit or create conf/mime.local.conf and add at the bottom entry: SVG image/svg+xml
If you want to disable cache for SVG files edit lib/plugins/svgpureInsert/svgpureInsert.php:
- define('SVG_CACHE', true); to define('SVG_CACHE', false);
- delete folder: lib/plugins/svgpureInsert/cache
Caching is enabled by default:
- folder lib/plugins/svgpureInsert/cache should have permissions to write
Overview
My intention was to create plugin which enables using built-in SVG images visualization engine in Firefox, Opera browsers. I just didn't want to have PNG's or JPG's - I love vector graphics ;)
Features:
- image like syntax, so it supports uploading and inserting SVG as a media files
- supports DokuWiki align syntax
- supports resizing !! - and this is what SVG is about :)
- caching enabled by default
- XHTML 1.0 valid
Known bugs/disadvantages:
- embedded as a iframe - no wiki url syntax support
- tooltip caption is not working (syntax is available) but Firefox is not displaying it
- SVG is supported by Firefox and Opera, NO IE (5.5, 6.0) support (IE 7.0 8.0 not tested)
- There is a browser plugin for IE 6 to display SVG. To be tested with this plugin.
How does it work?
- I've created syntax plugin which search for { {file_or_url.svg|description} } it's getSort is lower than media files, so it catch up everything nicely.
- Next step is search the base size of SVG
- When we got base size, we can count the size we want to display, and insert iframe tag to DokuWiki renderer
- We point iframe to svgpureInsert.php?url={url}&width={w}&height={h} which is used to change, and insert some SVG tags needed to resize the file
- After that when - CACHING is enabled in lib/plugins/svg/svg.php (default) - we save image in cache and display it as a svg/image+XML mime, when there is no CACHE we just display resized image and download it each time we refresh the page (despite the DokuWiki cache)
Version History
svgpureInsert 1.05
Thanks to Konstantin for sharing better code. Open Source rox!
- fixed issue appeared when you use dokuwiki over https (SSL)
- fixed issue with output of dia's SVGs
svgpureInsert 1.04
- changed name to svgpureInsert not to collide with svg plugin
- some other stuff done by: Goulven Guillard, thanks for sharing better code!:
- corrected the remote installation
- corrected preg_match regular expressions which didn't work fine
- set $_GET results into variables
svg_pureInsert 1.03
- some issues with “mm” and “px” size of svg
- other issues with resizing
- now supports remote installation