Robert Kiesling > quikwiki > quikwiki.cgi

Download:
quikwiki-1.6.tar.gz

Annotate this POD

CPAN RT

Open  0
Report a bug
Source  

NAME ^

quikwiki.cgi - Simple Perl/CGI Wiki.

SYNOPSIS ^

  # View the page named, "HomePage."
  http://<host>/quikwiki/quikwiki.cgi?HomePage   

  # Edit the page, "HomePage."
  http://<host>/quikwiki/quikwiki.cgi?&action=edit

  # Create and edit page named, "NewPage."
  http://<host>/quikwiki/quikwiki.cgi?NewPage&action=new

  # View the QuikReference page.
  http://<host>/quikwiki/quikwiki.cgi?QuikReference


  # If quickwiki.cgi is renamed or symlinked to index.cgi:

  http://<host>/quikwiki/?HomePage

  # Edit the page named, "MyPage."  
  http://<host>/quikwiki/?MyPage&action=edit 

  # Create and edit page named, "NewPage."
  http://<host>/quikwiki/?NewPage

DESCRIPTION ^

QuikWiki outputs HTML of text files ("pages") that contain Wiki markup tags (see, ""Text Markup"") and references to other pages and images ("words"). QuikWiki's words correspond to page and image files. When displayed, word references appear in HTML <a href> tags.

By convention Wiki words start with uppercase letters and contain mixed-case alphanumeric characters. These are valid words.

  HomePage
  AreaCode916
  TableOfContents
  Addresses

""Documentation Words"" and ""Action Words"," tell QuikWiki which action to take when displaying pages.

URL parameters provide page and action words. If the URL does not contain arguments, HomePage is the default page and view is the default action word. Refer to ""SYNOPSIS"," above.

To display a list of the words that QuikWiki knows about, use the, ""words"," word.

QuikWiki replaces JPEG and PNG words with the images and can display images separately with the "image" word.

Optionally, Revision Control System, if installed, can store page revisions. (See, ""Backups and Revisions"").

The template files, "WikiHeader," and, "WikiFooter," format page headers and footers. These files contain Perl code and are evaluated instead of displayed. (See, "Embedding Perl".)

Documentation Words

These are the documentation words that QuikWiki recognizes.

self

Output the QuikWiki source code. To save in a text file, use a shell command similar to the following.

  lynx -dump -width 100 http://<server>/?self >quikwiki.cgi

doc | pod

Print the POD documentation.

words

Display sorted list of words and links to pages.

  http://<server>/?words

Action Words

These are the action words that QuikWiki recognizes.

edit

Display the editor form and edit a page.

image

Display an image on a separate page.

  http://<server>/?image&<image_name>

new

Create and edit a new page.

view

Display the page - this is the default.

Text Markup

Paragraphs

Do not indent paragraphs. Separate paragraphs with a blank line.

Character Emphasis

Bold text begins and ends with three single quotes ('''). Emphasized (italic) text begins and ends with two single quotes ('').

Preformatted Text

Lines that begin with one or more spaces maintain their formatting and are printed in monospaced <tt> font.

Horizontal Rules

Lines that begin with four or more hyphens are displayed as rules.

List Items

List items begin with a tab and an asterisk, or eight spaces and an asterisk.

Backups and Revisions

QuikWiki uses RCS for revisions if the system has the rcs and ci programs, and the document directory contains a RCS subdirectory. Make sure that the Web server can write to the RCS subdirectory and archive.

QuikWiki uses non-strict locking for RCS revisions.

Without RCS or a RCS subdirectory, QuikWiki renames previous versions of the page with a .bak extension.

Page Directories

If Web site security requires that the QuikWiki CGI script be installed in a directory like cgi-bin, then you must tell QuikWiki where to find its pages.

The Web server environment variable, $WIKIPATH, contains a list of directories, separated by colons, that QuikWiki can search for its pages.

Refer to the file, README, for information about configuring, $WIKIPATH.

Embedding Perl

Lines within, "<%," and, "%>," get evaluated by Perl and then displayed. Pages that contain embedded Perl code can generate dynamic content. Here is a page that displays, "Hello, World!" and the date and time in bold type.

  Hello, world!  The date and time is:
  <%
    $t=localtime ();
    $a = qq{'''$t.'''};
    print lines ($a);
  %>

Values and operations are accessible via internal variables and functions. The variable $word, for example, is the name of the currently displayed page, and $s is the name of the HTTP server. The function lines(pagetext) performs markup formatting. Variables that you define within a template script are local to that template.

The templates, WikiHeader, and, WikiFooter, use embedded Perl to format page Headers and Footers.

VERSION ^

$Id: quikwiki.cgi,v 1.5 2007/06/26 04:26:53 kiesling Exp $

CREDITS ^

The idea for QuikWiki, and a few of the coding tricks, came from Scott Walter's tinywiki, although the code is (slightly) less obfuscated.

The text markup conventions come from WikiWiki.

Written by Robert Kiesling, rkies@cpan.org.

Copyright © 2003-2007 by Robert Kiesling. QuikWiki is licensed under the same terms as Perl. Refer to the file, "Artistic," for details.