Skip to content

marklagendijk/mediawiki-dia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MediaWiki Dia plugin

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.

Installation

  1. 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.

  2. Create a Dia folder in the extensions folder of your MediaWiki installation.

  3. Download and extract the plugin into the created folder.

  4. 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
  5. 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;
  6. 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.

Usage

Uploading

Just upload any .dia file. If everything is working correctly, it will show a thumbnail of the diagram.

Displaying

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]]

Editing

  1. Click on a displayed Dia diagram. This wil take you to the page of the diagram file.
  2. Click the link with the filename to download the .dia file. If this does not work, use right-click -> save as.
  3. Edit the .dia file on your local machine, using Dia, and save your changes.
  4. Upload the changed .dia file.

Credits

  • 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.

About

A MediaWiki extension which renders .dia files as .svg.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages