October 11, 2006

Beefing up DokuWiki with plugins

Author: Dmitri Popov

Desktop applications such as Firefox, Thunderbird, and the GIMP are not the only ones that can use extensions and plugins for added functionality -- some Web-based programs can too. DokuWiki, for example, is a great wiki system by itself, but since it can accept plugins, you can easily add some nifty features to it.

The best place to find DokuWiki plugins is the DokuWiki Plugins page, which acts as a central repository and discussion forum for plugin-related stuff. But before you can make use of the plugins, you need to know how to install them.

There are three ways to install plugins in DokuWiki. The easiest is to use DokuWiki's plugin manager in the Administration section. Log in to DokuWiki as administrator, click the Admin button at the bottom of the page, and click on the Manage Plugins link. Enter the link to a plugin package in the URL field and press the Download button to install the specified plugin.

Since the plugin manager requires write access to DokuWiki's lib/plugins directory, it may not always work on your particular DokuWiki installation. In this case, you can install plugins manually. Simply download the plugin package in zip format, unzip it, and upload the resulting folder to DokuWiki's lib/plugins directory.

Finally, some older plugins come as plain code listings. To install such plugins, you have to create folders and the necessary files manually. Most of these "raw" plugins provide detailed and easy-to-follow installation instructions.

The list of available plugins is impressive, and which plugins you choose to install depends, of course, on your needs. Here are some interesting plugins to whet your appetite.

DokuWiki plugins

gcalendar is probably the most impressive DokuWiki plugin. It turns a wiki into a flexible calendaring tool. Once you've installed it, you can add a calendar to any DokuWiki page using just a single line of code: <gcal pages=(mycalendarpage)>, where mycalendarpage is a wiki page containing your calendar data. The clever part is that gcalendar can handle multiple pages containing calendaring data, effectively turning a wiki page into a multi-user calendar. Better yet, you can separate the calendar pages from the rest of the wiki by creating a dedicated namespace -- for example, calendar -- and restricting access to it.

The gcal command accepts a wide range of options, which allows you to display the calendar in many different ways. For example, the following code displays a weekly calendar containing calendaring data from the daniel, andrew, and tristan pages.

  <gcal pages=(:calendar:daniel,:calendar:andrew,:calendar:tristan) mode=week>

The page containing calendaring data is simple, and looks something like this:

  ====== Tristan's calendar =====

  ==== Work ====

    * 27.11.2006 09:30 Work

  ==== Travel ====

    * 07/17/2006 Berlin

  ==== Vacations ====

  11/01/2006 - 11/31/2006 Vacation

  ==== Birthday ====

    * 12.02.2007 My birthday

The headers represent the categories specified in the plugin's style.css file, which is in the same folder as the rest of the plugin's files, and you can use both European (DD.MM.YYYY) and US (MM/DD/YYYY) date formats, as well as specify date ranges.

You can customize virtually any aspect of the calendar by modifying the style.css file. For example, you can easily add a new category to your calendar by specifying it in the file. Let's say you want to add a new category called "Work." Open the style.css file, scroll to the bottom, and add the following code:

  .gCal_cat_WORK {
  	color: Gray;
  	font-weight: bold;
  	background-image: url(images/work.png);

Upload the work.png image into the images folder inside the plugin folder, and you are done.

gcalendar doesn't offer some advanced features, such as recurring events, invitations, or conflict management, but if you want to give wiki users a calendar they can use for collaboration, gcalendar is just the ticket.


While DokuWiki allows you to create simple outlines using lists, the Outliner plugin takes outlining to another level. Using the plugin, you can create sophisticated outlines with collapsible nodes. Like other DokuWiki plugins, Outliner uses simple custom markup. The following code, for example, specifies a node:

  --> Node 1
  Some text goes here.
  <--Node 1

To make the node unfolded by default, use the ^ mark (e.g. --> Node 1 ^). Nested nodes look something like this:

  --> Node 1
  Some text goes here.

    --> Node 2
    More text goes here.
    <-- Node 2

  <-- Node 1

By default, when you hover the mouse over Node 1, a pop-up menu displays the contents on the node. To turn this feature off, use the # mark (e.g. Node 1 #).

Note boxes and other wordly stuff

As the name suggests, DokuWiki is commonly used for tutorials, how-tos, manuals, and other types of documentation. The Notes plugin allows you to spice up your documentation by adding note boxes. The plugin includes four default type of notes: plain, warning, tip, and important. You can add them using the following markup:

  Plain note

  <note warning>

  <note tip>

  <note important>

You can also customize the overall appearance of the notes by editing the style.css file.

Fancy those word clouds you often see in blogs? You can add a cloud of the most commonly used words in your wiki, courtesy of the Cloud plugin. To do this, simply insert the ~~CLOUD~~ code into the wiki page where you want the cloud to appear. If you want to exclude certain words from the cloud, create the stopwords.txt file containing these words and save it in the conf directory.

The Styler plugin adds four additional styles, which you can use to jazz up your wiki pages. This plugin allows you to format text as epigraphs (the <epigraph></epigraph> tags), quotations (the <quote></quote> tags), verses (the <verse></verse> tags), and generic style blocks (the <style></style> tags).

Want to ask your readers a question and hear what they have to say? Using the Poll plugin, you can easily add a poll to any page. The simple markup helps you to create the poll in a matter of minutes:

  <poll My poll>
    * Answer 1
    * Answer 2

Dmitri Popov is a freelance writer whose articles have appeared in Russian, British, German, and Danish computer magazines.


  • Enterprise Applications
Click Here!