Provides a parser function to generate diagrams and flowcharts with the help of the mermaid script language
Switch branches/tags
Nothing to show
Clone or download

README.md

Mermaid

Build Status Latest Stable Version Packagist download count

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"
	}
}
  1. From your MediaWiki installation directory, execute composer require mediawiki/mermaid:~1.0
  2. Add wfLoadExtension( 'Mermaid' ); to the "LocalSettings.php" file
  3. 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!
}}

image

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.

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.

License

GNU General Public License, version 2 or later.