An Embedded Wiki For Konqueror

Summary

The EmbedWikiPlugin is a KPart which provides the accessible editing features of a Wiki from within the the Konqueror browser. This combines the convenience of local browsing and editing with the simplicity of use of Wikis, but without the overhead of a web server.

Introduction

With the release of the PyKDE components package for PyKDE comes the possibility of being able to package and embed Python applications within the framework and infrastructure of the K Desktop Environment. In particular, this package allows various forms of embedded components to be written in Python with the aid of a minimal amount of automatically generated C++.

One of the exciting things about Konqueror is that it allows developers to write components which run within a standards compliant web browser and file manager. In web browsing mode, plugins have access to the Document Object Model (DOM) for each web page; in file management mode, components called KParts provide the facilities for viewing and editing documents, including web pages. This presents an opportunity to develop applications which would otherwise require substantial development and duplication of effort; especially those which wish to present information in the form of hypertext.

By following example code, such as that found on the http://developer.kde.org/ site and by examining existing components, it has been possible to implement a component for Konqueror which allows a simple Wiki-style textual description to be edited alongside (or beneath) its corresponding hypertext representation.

Setting up the Wiki

Once the EmbedWikiPlugin component is installed, it should be possible for you to enable it as an embedded viewer for text files. This is achieved by opening Konqueror's Settings menu and selecting Configure Konqueror. The dialog window which opens can also be accessed via the Control Centre. In this configuration dialog, perform the following actions:

You should now be able to navigate to a directory containing a suitable text file and open it either by clicking it with the left button, or by opening the popup menu with the right button and selecting EmbedWikiPlugin from the Preview In menu entry.

Getting started

To begin, you first need an existing text file. This may initially be empty, or it could contain existing content. Use Konqueror to navigate to the directory containing this file and perform one of the following actions, depending on the Left Click Action you enabled in Konqueror's preferences dialog:

If the file is empty, you should be presented with a view similar to that in the following image:

Editing a page

You may now begin editing the page using formatting commands to structure text and add new pages.

Wiki modules

Since there are many different dialects used by Wikis, it is useful to provide support for more than one text processing module. Indeed, a number of modules are provided in the Modules subdirectory of this package. These are installed alongside the KPart and can be selected via the configuration dialog:

You should now see a dialog like this:

Configuring the processing module

The Module entry in the above dialog allows a Python module to be selected from those available in the installation directory. These include a simple text processor, a processor with a more structured formatter and a wrapper for the reStructuredText HTML formatter.

Configuring the browser area

The Wiki KPart splits the view horizontally into two regions with the HTML view shown above the text editor. By default, each of these regions is allocated the same amount of space. However, it is possible to specify the relative proportions of each of the areas by changing the values presented in the Appearance tab of the configuration dialog.

Bugs and things to do