Integrate diagrams.net service to create and edit diagrams in DokuWiki
Compatible with DokuWiki
Similar to diagramsnet, drawio
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
This plugin lets users create and edit diagrams in DokuWiki. In provides an integration with the online diagramming tool diagrams.net, previously known as draw.io.
The plugin provides two different ways to store the resulting diagrams:
<diagram>
syntax. Editing a diagram always edits the page it is embedded on (creating a new page version) and ACLs match that of the page.Which modes are available to your users is configured in the plugin's configuration settings.
Please note that diagrams can not easily be transferred from one mode to the other.
Creating a diagram differs depending on the used storage mode:
Create diagram
link. Next, enter the file name for the diagram in the dialog that appears. Do not use any special characters here. You will be redirected to diagrams.net where you can create your diagram. Clicking on the Save
button will take you back to your wiki.<diagram>
syntax can be used. Alignment can be picked via the left
, right
and center
keywords. Sizes can be given as widthxheight
in pixels. Eg. <diagram center 300x200>
.Existing diagrams can always be edited from viewing a page that uses the diagram. The diagram will have a “Edit Diagram” button if the current user has the appropriate permissions to edit the diagram. This works for both storage modes.
Depending on the storage mode, edits can also happen elsewhere:
View
tab, an “Edit Diagram” button will be displayed when a diagram image is selectedThis plugin support the Prosemirror WYSIWYG Plugin for both modes. New diagrams can be inserted via the toolbar. Diagrams are shown within the editor (interactive mechanisms like links are disabled in the editor) on click their properties can be changed and the diagram editor can be opened.
The plugin works with SVGs by default. However SVGs created by diagrams.net use certain features (most notably multiline and formatted texts) that only work, when the SVG is displayed in a Webbrowser. This means that those features will be lost when exporting to PDF using the dw2pdf Plugin. Please note that this is not true when using the browser's “Print to PDF” mechanism.
To work around this, the Plugin can optionally save a PNG based cache file for each diagram on saving and use that cache file when exporting to PDF. Enable the pngcache
option in the configuration of the plugin to enable it. Please note that only diagrams saved after enabling this option will have PNG cache file. You will need to resave your existing diagrams to make use of that feature.
This plugin was inspired by a few other plugins that integrate diagrams.net/draw.io into DokuWiki. Below you can find a small feature comparison.
diagrams (this one) | diagramsnet | drawio | |
---|---|---|---|
Format | SVG (PNG optional for PDF Exports) | PNG | PNG (SVG with additional Plugin) |
Storage | mediafile, embed | mediafile | mediafile |
Links in Diagrams | ✅ yes | ❌ no | ❌ no |
Custom Diagrams Host | ✅ yes | ✅ yes | ✅ yes |
Draft saving for Diagrams | ❌ no | ❌ no | ✅ yes |
PDF Export | ✅ yes | ✅ yes | ✅ yes |
ODT Export | ❌ no | ❌ no | ❌ no |
The source code of the plugin is available at GitHub: cosmocode/dokuwiki-plugin-diagrams.
Please refer to the Issue Tracker for reporting issues.