Extension:DrawioEditor

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
DrawioEditor
Release status: beta
Implementation Parser function
Description draw.io editor integration
Author(s) (Markus Geberttalk)
License MIT License
Download https://github.com/mgeb/mediawiki-drawio-editor
Hooks used
OutputPageParserOutput
ParserFirstCallInit
Translate the DrawioEditor extension if it is available at translatewiki.net
Check usage and version matrix.

Overview[edit source]

This is a MediaWiki extension that integrates the draw.io flow chart editor and allows inline editing of charts.

The source and full documentation is available on GitHub: https://github.com/mgeb/mediawiki-drawio-editor

Warnings[edit source]

Please read these warnings carefully before use:

  • The actual editor functionality is loaded from draw.io. This code only provides integration.
  • Be aware that draw.io is an online service and while this plugin integrates the editor using an iframe and communicates with it only locally in your browser (javascript postMessage), it cannot guarantee that the code loaded from draw.io will not upload any data to foreign servers. This may be a privacy concern. Read the Privacy section in the documentation on GitHub for more information. When in doubt, don't use draw.io or this module. You have been warned!
  • This plugin is quite new and probably still has bugs, so it may or may not work with your installation.

Features[edit source]

  • draw.io chart creation and editing.
  • SVG and PNG support. The file type can be configured globally and changed on a per-image basis.
  • Inline Editing and javascript uploads on save, you never leave or reload the wiki page.
  • Image files are transparently stored in the standard wiki file store, you don't need to worry about them.
  • Versioning is provided by the file store, revert to an older version of the chart at any time.
  • Draw.io original XML data is stored within the image files, so only one file must be stored per chart.
  • Supports multiple charts per page.
  • Supports relative and fixed chart dimensions.

Requirements[edit source]

  • When you intend to use SVG which is recommended, you might want to install Extension:NativeSvgHandler too. Also you need a browser that supports SVG.
  • While displaying charts may work in older browsers, especially when using PNG (SVG is default and recommended), saving charts requires a fairly recent browser.

Installation[edit source]

  1. Clone this extension from GitHub into a folder named DrawioEditor within your wiki's extensions folder:
    cd /where/your/wiki/is/extensions
    git clone https://github.com/mgeb/mediawiki-drawio-editor DrawioEditor
  2. Activate the plugin in LocalSettings.php
    require_once "$IP/extensions/DrawioEditor/DrawioEditor.php";

Usage[edit source]

Add the following to any wiki page to insert a draw.io chart:

{{#drawio:ChartName}}

Save the page and you'll see a placeholder with an Edit link on its top right. Click it to start the draw.io editor.

Please head over to GitHub for further usage instructions and examples: https://github.com/mgeb/mediawiki-drawio-editor#usage

See also[edit source]

Links[edit source]