Summary: Embedding Scalable Vector Graphics (.SVG) into PmWiki pages
Prerequisites: pmwiki 2.2.58
(originally written by Pm
Can Scalable Vector Graphics (*.svg) be embedded into wiki pages?
The svg.phpΔ script causes links ending in ".svg" to be converted to embedded svg-grafs (similar to how images are automatically embedded into pages).
Place the svg.phpΔ script in your cookbook/ directory, add the line
to your config.php file, and any link ending in ".svg" will automatically be converted to HTML code for an embedded svg graphic.
If you want up upload svg-files you have to enable the file type. Add this to config.php:
$UploadExts['svg'] = 'image/svg+xml';
$UploadExts['svgz'] = 'image/svg+xml';
When using this, the
%width=300 height=200% WikiStyle has to be placed before the svg file name to define the painting area (set the width and height of your graphic in pixels).
When installed with Cookbook:Ape, this recipe doesn't allow the Ape recipe to define the frame width and height.
- 20161021 Disable core handling of SVG links (since PmWiki 2.2.85), fix $RecipeInfo.
- 20150919 Update for PHP 5.5, use non conflicting $SvgTagFmt variable, accept ".svgz" extension, add $RecipeInfo.
See discussion at Svg-Talk.
User notes +1: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.