Word processing with DokuWiki

Custom Made


DokuWiki offers some capabilities not found in other web-based word processors. We'll show you how to build your own web-based word processing tool with DokuWiki and a few plugins.

By Dmitri Popov

Web-based word processors are all the rage these days, but you don't have to hand your documents to a third-party service to enjoy the benefits of online word processing. Instead, you can build your own web-based word processing tool with DokuWiki [1] (Figure 1). Of course, DokuWiki won't rival a dedicated web-based word processor, but it does have a few powerful features that can make it a better choice in many situations.

Figure 1: Who needs Google docs when we have DokuWiki?

Obviously, the main advantage of using DokuWiki on your own server is the full control you have over the software and your documents. Virtually every aspect of your DokuWiki installation can be tweaked, and you don't have to worry about storing your documents with a third-party service provider.

Better yet, you can install DokuWiki on a local network, which ensures that you can still access your documents and continue to work on them even if your net connection is down.

DokuWiki offers capabilities not found in web-based word processors, including syntax coloring of code blocks, page templates, and automatic generation of a table of contents. Also, DokuWiki comes with an advanced diff feature, which provides an efficient way of tracking changes in the documents. Combined with the revisions feature, diff can act as a powerful versioning tool.

Using plugins, you can add almost any feature imaginable, including the ability to insert graphs, chemical formulas, BibTeX bibliographies, hidden comments, and much more. In addition, you can even add more advanced features such as a document readability analyzer.

Furthermore, DokuWiki offers flexible and powerful user access control capabilities, which you can use to specify access rights to individual pages and folders (called namespaces in DokuWiki).

Of course, DokuWiki has a few weak spots. For example, there are no WYSIWYG editing capabilities (although the main toolbar provides buttons for the most common formatting options), moving pages between different namespaces is not as easy as it could be, and more importantly, there is no find/replace feature. Still, if you think that DokuWiki's advantages outweigh its weaknesses, then you are ready to turn it into a web-based word processor. For starters, I'll look at the built-in DokuWiki features that you might find useful.

Security

Security is crucial when it comes to working with your documents on the web, so it's important to understand how the DokuWiki access control features work and how to use them efficiently. In DokuWiki, you can set up an administrator account, which gives access to two important features: User Manager and Access Control List (ACL). The former allows you to add and manage DokuWiki users (handy for collaborative editing), and the latter is used to specify their privileges. Using ACL, you can restrict access to individual pages and namespaces and specify access privileges such as the rights to view, edit, create and delete pages, and upload files (Figure 2). In short, ACL offers better access management tools than any other word processing app on the web.

Figure 2: DokuWiki's ACL features help you control access to pages and namespaces.

Keep in mind that even if you restrict access to a page, it will still appear in the DokuWiki's built-in RSS feeds and on the Index page, but DokuWiki has a solution to this problem. In the Configuration Settings | Advanced Settings section, a field called Hide matching pages lets you add the pages you want to hide, and you can use regular expressions, too. For example, if you want to hide all pages with names starting with "secret", enter secret$ in the field. Also, you can specify multiple pages by separating them with the pipe sign - for example, tip$|secret$.

Another useful feature you won't find in any web-based word processor is the ability to create namespace templates [2], which can come in handy when every page you create in DokuWiki must contain default content. Moreover, DokuWiki templates support a handful of predefined macros such as @NAME@ (user who created the page), @MAIL@ (user's email address), and @DATE@ (date and time when the editing session started). To create a template, launch your favorite text editor, add the content and macros you want to appear on each page, save the file with the _template.txt name, and upload the file to the desired namespace.

One of the most useful features for writing professionals is word count. By default, DokuWiki doesn't have the ability to count words, but this feature can be added with a hack by DokuWiki's developer [3]. This solution places a simple counter in the lower left-hand corner of the editing area, which displays the word count of the currently edited section and the overall word count of the whole page.

Also, DokuWiki supports spellchecking, but enabling this useful feature requires a bit of tinkering; however, if you are using Firefox, you can just add a dictionary for the desired language to the browser and use it to spell check your documents.

Plugin Power

Although DokuWiki's built-in features can be used for basic word processing, you can expand its functionality by installing some plugins. By default, renaming pages and moving them between namespaces is rather cumbersome. The PageMove plugin [4] provides a solution. Once installed, PageMove allows you to move and rename pages via the dedicated section in the Administration area; this is not as easy as drag and drop, but it's significantly more elegant than deleting and recreating pages.

If you are looking for a more flexible way to keep track of your documents, you can use the Tag plugin [5] to organize your documents conceptually by simply tagging them. For example, if you write an article about configuring a wireless connection on Mandriva Linux, you can tag it as {{tag>linux mandriva wireless}}. The best part of this feature is that you can generate a list of documents containing a certain tag quickly by inserting the {{topic>Tag}} code into any DokuWiki page. For example, to list all articles containing the Mandriva tag, use the {{topic>Mandriva}} code. Also, you can even create a dedicated page to list all documents by their tags.

The DokuWiki plugin repository [6] contains a few handy plugins that allow you to work with text and collaborate on a document more efficiently. The Hidden Comment plugin [7], for example, allows you to insert comments that are not visible in the view mode but that can be useful if you need to add notes and comments for other users without making them visible in the final documents. To add a hidden comment, enclose the text you want to hide in the /* and */ tags.

As the name suggests, the Highlight plugin [8] allows you to add the text highlighting feature. With this plugin installed, you can highlight a text segment with the <hi></hi> tags.

The Changemarks plugin [9] takes the highlighting feature a step further; you can use it not only to highlight portions of text but also to mark them as deleted or inserted, which can come in handy when proofreading a document. Note [10] is another nifty plugin than can be useful when writing tutorial-style articles because you can use it to insert text boxes containing tips, warnings, and sidenotes (Figure 3).

Figure 3: Using plugins, you can add new features like Notes to DokuWiki.

Finally, if you are working on a research paper or a document containing a bibliography, you can insert bibliographic entries in BibTeX format and let the BibTeX plugin [11] (Figure 4) format it nicely.

Figure 4: The BibTeX plugin allows you to insert bibliographies in DokuWiki pages.

Exporting Documents

DokuWiki wouldn't be of much use if you couldn't export pages in formats readable by other applications.

Fortunately, there are a few ways you can turn DokuWiki pages into documents you can save on your desktop. If you want to save the page as an XHTML file, you can do so by adding the ?do=export_xhtml command to the page's URL. This command converts the currently viewed page into a relatively clean XHTML file, which you can save on your local machine. In most situations, you might want to save DokuWiki pages in the ODT format so you can open them in OpenOffice.org Writer.

When you install the OpenOffice.org Export plugin [12], you can add the Export icon to any DokuWiki page by inserting the ~~ODT~~ macro somewhere in the page. Clicking the icon converts the page into an ODT document, which you can then open in Writer, edit, and save in any other format.

As you can see, with a little bit of work and a few plugins you can can turn DokuWiki into a flexible word processing application.

DokuWiki might not have a fancy GUI or WYSIWYG editing tools, but when it comes to features, this tool not only matches the web-based word processors, it beats them.

INFO
[1] DokuWiki: http://wiki.splitbrain.org/wiki:dokuwiki
[2] Creating namespace templates: http://wiki.splitbrain.org/wiki:namespace_templates
[3] Word count hack: http://wiki.splitbrain.org/wiki:tips:wordcounter
[4] PageMove plugin: http://www.isection.co.uk/doku.php?id=start
[5] Tag plugin: http://wiki.splitbrain.org/plugin:tag
[6] DokuWiki plugin directory: http://wiki.splitbrain.org/wiki:plugins
[7] Hidden Comment plugin: http://wiki.splitbrain.org/plugin:comment
[8] Highlight plugin: http://www.staddle.net/dokuwiki/plugins/highlight
[9] Changemarks plugin: http://www.wikidesign.ch/en/plugin/changemarks/start
[10] Note plugin: http://wiki.splitbrain.org/plugin:note
[11] BibTeX plugin: http://tinyurl.com/yzwu6h
[12] OpenOffice.org Export plugin: http://wiki.splitbrain.org/plugin:odt