<graph>-Plugin for Mediawiki

Motivation

Top -^
Teamwork -------------------------->
is the key to
Victory

Mediawiki is the software used by the popular Wikipedia. It allows humans very easily to create, maintain and improve documents in shared environments.
One of the strengths of the software is that the content is seperated from the layout. This means that the source of a document/page/article specifies the structure of the information, but usually not how the information is finally rendered in the browser.

Today you can easily enter text (headlines, paragraphs, lists etc), tables, lists and even mathematical formulas.

What is missing, however, is an easy way to describe flow graphs like network plans, flow charts, organizational diagrams and similiar things.

This project changes this.

Status and Development

Top -^

This extension is quite stable and works good - have a look at the "graphic" at the top of this page :)
However, some features still need to be implemented, and of course, bugs to be fixed.

Currently the development goes in the following directions:

Read more details about the current limitations in the underlying graphing package.
These limitations will be overcome when the software behind the scenes improves. However, the software already works quite good. If you find anything missing or encounter bugs, please file a bug report at rt.cpan.org.

Goals

Top -^

This project has a few goals:

The last point is quite difficult to define, and without definition of what looks good we cannot achive that goal. However, there are a few rules we should obey:

How it works, Testcases and Examples

Top -^
Textual description ------> Parser ------> Layouter ------> Output (ASCII/HTML/SVG etc)

The Mediawiki extension takes text between <graph> and </graph> and feeds it to an external program. This uses a Perl module named Graph-Easy to render the graph description either as ASCII art, as pretty HTML, as Scalable Vector Graphic (SVG) or a graphviz code, which can be fed to dot to render PNG files.

The graph text syntax is modelled after an easy mnemonic ("[ Bonn ] --> [ Berlin ]" looks already like the final graph will be typically rendered, two boxes connected by an arrow) and the most important feature is ease-of-use and simplicity (for both human and machine). The language is (almost completely) white-space, newlines and order invariant, and supports full Unicode. This means you can move objects around, insert white-space and newlines to make the source more readable, without accidentily changing the resulting graph or layout.
The language also separates style from content by allowing all objects to have a class and attributes to be set class-wide, thus enabling quick style changes of everything with little edit effort.

Please see the online manual for many examples and explanations.

You can see the Mediawiki integration at work at this Mediawiki graph test page.

Mediawiki-POD

Top -^ The Mediawiki-POD extension also uses Graph::Easy to parse graph paragraphes embedded into POD to generate HTML documents such as this perl atlas.

Software and Download

Top -^

Graph::Easy has no dependencies itself (except Perl v5.8.1 or better), but to integrate it into Mediawiki, you need the following additional Perl modules (and/or graphviz):

The following optional packages can be used to get more output options:

If http://search.cpan.org is down, you can also look here for the Perl modules.

You can either install these Perl modules into your system (this needs usually administrator rights), or install them locally into a directory. The latter step is explained in detail in the mediawiki-graph extension's INSTALL file.
To install the Perl modules in your system, you can use CPAN for this:

  su
  perl -MCPAN -e 'shell'
  > install Graph::Easy
  > install Digest::SHA1
  > install Config::Tiny
  > install Graph::Easy::As_svg

This will install all dependencies, too. If the automatic install fails, for most Perl modules out there you can use the following sequence:

untar Some-Perl-Module-0.01.tar.gz
chdir Some-Perl-Module
perl Makefile.PL
make test
sudo make install

If unsure, a file called INSTALL or README in each of these modules will have further info.

Then unpack the mediawiki-graph-0.21.tar.gz file and integrate it into Mediawiki by following the instructions in the README (it's easy :-). Afterwards it should work like in the screenshots below.

The Graph::Easy distribution contains also a script called graph-easy, which is installed into your system so you can use it from the any prompt. This script parses and outputs the various graph formats and thus allows conversion between the formats as well as rendering either via Graph::Easy or dot et al. For more information see the graph-easy online help or type graph-easy --help.

Screenshots

Top -^

There is also a page with screenshots.

TODO, Contact and Bugreports

Top -^

Here is a short list of things to do regarding the Wikimedia integration:

The underlying software package, Graph::Easy, also needs a lot of work. Please see the TODO list and the Graph::Easy limitations.

Contact and Bugreports

If you have questions, feel free to send me an email (Gnupg key). Bugreports should go to rt.cpan.org.

Credits

Top -^

I would like to thank the following people (in alphabetic order):

See also the Wikimedia Graphviz extension and WikiSophia.

Wikis

Top -^

The following sites (list is not complete) already use this extension or Graph::Easy: