Mermaid
This extension provides the #mermaid
parser function to support the generation of diagrams and flowcharts with the help of the mermaid script language. Supported diagram forms include:
- Flowchart
- Sequence diagram
- Gantt diagram
Requirements
- PHP 5.6 or later
- MediaWiki 1.27 or later
Installation
The recommended way to install Mermaid is by using Composer with an entry in MediaWiki's "composer.json" file or preferably "composer.local.json" file.
{
"require": {
"mediawiki/mermaid": "~1.0"
}
}
- From your MediaWiki installation directory, execute
composer require mediawiki/mermaid:~1.0
- Add
wfLoadExtension( 'Mermaid' );
to the "LocalSettings.php" file - Navigate to Special:Version on your wiki and verify that the package have been successfully installed.
Usage
The #mermaid
parser function allows to add mermaid typed content to a wiki article. For example, copying examples is as easy as:
{{#mermaid:sequenceDiagram
participant Alice
participant Bob
Alice->John: Hello John, how are you?
loop Healthcheck
John->John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail...
John-->Alice: Great!
John->Bob: How about you?
Bob-->John: Jolly good!
}}
Contribution and support
If you want to contribute work to the project please subscribe to the developers mailing list and have a look at the contribution guideline.
- File an issue
- Submit a pull request
- Ask a question on the mailing list
- Ask a question on the #semantic-mediawiki IRC channel on Freenode.
Tests
This extension provides unit and integration tests that are run by a continues integration platform
but can also be executed using composer phpunit
from the extension base directory.