Wiki engine
From Wikinfo
- Alternate views: wiki software at Wikinfo, WikiEngine and WikiPrinciples at C2
A wiki engine is a computer software program that controls a wiki. In turn, a wiki is a web site that allows users to modify that site using their web browser. The duties of a wiki engine are to store the wiki pages, to format the wiki pages for web browsers, and to present web forms for editing those pages. The first WikiWikiWeb at C2 has the most authoritative list of wiki engines.
Contents |
Example of use
Wikinfo is an example of a wiki. Its wiki engine, called GetWiki, has stored this page (which contains this encyclopedia article about wiki engines) and now presents it to you. If you click "edit this page", you will reach the web form for changing this article, but that only works if you first log in to Wikinfo.
Wiki engines and web servers
Before a wiki web site can exist, someone must install a wiki engine onto a web server such as Apache. The web server and the wiki engine run on the same computer but have different responsibilities.
- The web server listens for connections, accepts connections from web browsers, and speaks to web browsers using the Hypertext Transfer Protocol (HTTP). HTTP allows the web server to send web pages to the browser and to receive form inputs. HTTP also allows the web server to accept form inputs, such as search engine queries or edited wiki pages.
- The wiki engine stores and formats each wiki page. When the web server wants to send a wiki page to some web browser, then the wiki engine supplies the page. When a web browser submits a modification to the page, then the web server forwards the request to the wiki engine for handling.
A web server can exist without a wiki engine; the web site might only have static HTML pages, or online shopping, or online forums, but no wiki. However, a wiki engine is useless without a web server. In a few implementations, the same program is the wiki engine and the web server, but in most cases, the wiki engine and web server communicate through the Common Gateway Interface (CGI).
UseModWiki as an example
UseModWiki is a CGI script of the Perl programming language. Several different wiki web sites use UseModWiki, but we will focus UseModWiki's own website. The script is located at this location:
The webmaster at www.usemod.com has configured the web server to run the Perl script called wiki.pl when someone visits this location. By default, the wiki.pl script displays the home page of the wiki.
Most wikis have more than one page, and the wiki engine allows the reader to see other wiki pages. This requires a parameter to the wiki.pl script specifying the name of the page. The home page of UseModWiki has links to other wiki pages, such as this one:
The question mark "?" starts the parameters. This here is a request to GET the SandBox page.
Because UseModWiki is a wiki engine, it must provide some way to edit the page with a web browser. One can do that by clicking the "Edit text of this page" link at the bottom of the page. It points here:
This is a request to GET a web form to modify the SandBox page. The web form includes a text area with the current content of the wiki page, and a "Save" button to save the modified page. (UseModWiki also provides some other features, such as the Summary box and the Preview button.)
The user can edit the text area, then use the "Save" button to change the wiki page. That takes the browser to this location:
How does the script know to save the SandBox home page instead of displaying the home page? This was actually a POST request, not a GET request. The web browser sent the modified SandBox page (and the fact that the user clicked "Save") as POST information that does not appear as parameters in the location. In general, a POST operation modifies something (such as editing a wiki page, adding a T-shirt to a shopping cart, or confirming a subscription to a mailing list) while a GET information only retrieves something (such as the wiki page called SandBox, the current contents of a shopping cart, or mailing list archives).
UseModWiki responds to the POST request by storing the new version of the SandBox page, then sending the new page back to the web browser. Thus, after saving the page, the user arrives back at http://www.usemod.com/cgi-bin/wiki.pl?SandBox which now shows the changes that the user made.
Wiki markup
Wiki markup is a set of text formatting rules for a wiki page. Most wikis only provide a plain text area for editing a page, so there must be rules for dividing paragraphs and for making links to other wiki pages.
Traditionally, most wikis use a blank line to divide paragraphs and a CamelCase word to make links to other wiki pages. (Some wikis, including Wikinfo, do not support CamelCase.) Thus the blank line and the CamelCase word are two common features of wiki markup. A consequence of this is that all wiki pages must have CamelCase titles, where CamelCase is a BunchOfWords that are TogetherLikeThis.
Some wikis also have other features, such as bold or italic text, or tables, or free links to pages that are not CamelCase. Here is an example of wiki markup in UseModWiki:
(UseModWiki) Here is some '''bold''' and ''italic''. This is a CamelCase link and a [[free]] link. Here is a [[SandBox|link to the sandbox]] and a [http://www.wikinfo.org link to Wikinfo].
|| Addition || 2 || 3 ||
|| 4 || 6 || 7 ||
|| 8 || 10 || 11 ||
Here is the same example in PBwiki:
(PBwiki) Here is some **bold** and ''italic''. This is a CamelCase link and a [free] link. Here is a [SandBox|link to the sandbox] and a [http://www.wikinfo.org|link to Wikinfo].
| Addition | 2 | 3 |
| 4 | 6 | 7 |
| 8 | 10 | 11 |
Either of the above would format somewhat like this:
Here is some bold and italic. This is a CamelCase link and a free link. Here is a link to the sandbox and a link to Wikinfo.
| Addition | 2 | 3 | 4 | 6 | 7 | 8 | 10 | 11<//td> |
Features of wiki engines
Wiki engines have been programmed in several different languages, including at least C, Java, Perl, PHP, Python, and shell script. Each wiki engine provides different features. Here is a list of features from some wiki engines.
- Access control uses passwords or other mechanisms to limit who can read or edit the wiki. For example, a blog-wiki ("bliki") might allow everyone to read but only one to edit. A large, openly edited wiki such as Wikinfo often needs features to lock certain pages or ban certain users.
- Application programming interface (API) allows software programs to automatically access or change the wiki. The PBwiki API is an example.
- Comments allow users to discuss each wiki page. This may simply be a line of comments below the page, or threads of comments and replies, or use separate wiki pages ("talk" or "forum" pages) to hold a comments.
- Extension mechanism allows programmers to add more features to a wiki engine. For example, there are many Modules available for the Oddmuse wiki engine. Oddmuse even permits extensions to the wiki markup, such as the Creole Markup Extension.
- Groups of pages allow users to work on separate collections of wiki pages within the same wiki, while still having links between the groups. The WikiGroup feature of the PmWiki engine is the model implementation.
- Import and export allows users to add or retrieve a large group of wiki pages at once. For example, Wikipedia exports the markup of its pages as XML, and Wikinfo imports them. The export is a feature of the [[MediaWiki] engine, while the import is a feature of the GetWiki engine.
- Point-and-click editing lets users edit pages with a graphical user interface instead of wiki markup. However, this only works in the newest versions of some web browsers. This is also a difficult feature to implement and tends to cause many bugs. PBwiki has a good implementation that does not break when someone comes by with a different browser; one can demo it at wysiwyg-test.
- Revision log permits users to access or restore old versions of wiki pages. C2 only stores the last revision from a different author, but some wiki engines, such as UseModWiki, store the last few revisions from the last few authors, and provides features to list and compare those revisions. Many wiki engines now store the entire history of the wiki.
- Statistics count how many pages a wiki has, or which pages are the longest, or generate some other useful information. See for example Wikinfo's Special:Statistics page, a feature of GetWiki.
- Tagging involves assigning labels such as "computing" or "funny" to pages, then allowing users to search for pages with the same tag.
- Uploading files allows users to attach images, audio, video, or documents to the wiki. Sometimes this involves embedding them within the wiki page, but sometimes this only involves listing them at the end for others to download.
Copyright and license
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License.

