This MediaWiki Dia plugin allows Dia diagrams to be embedded/rendered inside MediaWiki pages. It can be used to have thumbnails of specified size to be automatically generated from the uploaded .dia files.
This is achieved by having Dia installed on the server, and calling Dia to render the .dia
file as .svg
.
-
Install Dia on your MediaWiki server, and add it to your PATH, if neccesary. Verify whether it works by opening a command prompt and executing
dia -h
. -
Create a
Dia
folder in the extensions folder of your MediaWiki installation. -
Download and extract the plugin into the created folder.
-
To activate the extension, add the following line to your LocalSettings.php file (near the end):
require_once( "$IP/extensions/Dia/Dia.php" ); # Load Dia extension
-
Make sure that you have MediaWiki configured to allow for file uploads, this settings is already in LocalSettings.php, but defaults to
false
:$wgEnableUploads = true;
-
If you have an older version you might need to run the appropriate
mimetype
patch. Try uploading a.dia
file to see if this is neccesary.
Just upload any .dia
file. If everything is working correctly, it will show a thumbnail of the diagram.
Add an File
tag pointing to the .dia
file. The diagram will always display with the correct ratio, specified width
and height
are treated as maximums. Some examples:
Default size:
[[File:MyDiagram.dia]]
Specify width and height:
[[File:MyDiagram.dia|500x300px]]
Specify width only:
[[File:MyDiagram.dia|500px]]
- Click on a displayed Dia diagram. This wil take you to the page of the diagram file.
- Click the link with the filename to download the
.dia
file. If this does not work, use right-click -> save as. - Edit the
.dia
file on your local machine, using Dia, and save your changes. - Upload the changed
.dia
file.
- Marcel Toele: wrote the original Dia plugin in 2007.
- Vitaliy Filippov: forked the original Dia plugin after it was abandoned, and kept it working kept it working from 2011 - 2014.
- Mark Lagendijk: wrote this new Dia plugin, using the original plugin as example and inspiration, but displaying images as
.svg
instaed of.png
, solving several problems of the original plugin.