User's Guide

User's Guide for miniWiki 0.2

Preamble

Advanced topics are marked with (A). Needs reorganization/rewrite.

README

At first read README file distributed with miniWiki packages.

Wiki Concept

Wiki is composed of pages which are written in special Wiki markup (rendered as HTML when viewed). These page may be interlinked. Each page consists of set of revisions, latest revision called HEAD. Page update adds new revision.

Interface

Interface is composed of header, body and footer. Header shows page name (possibly with current action description):

Editing User's Guide

There may also be some information text (like "Page updated", "Login invalid") below page name.

Footer looks like this:

Main Page | Logged as admin | Revision: HEAD (3) | View Source | 2005/04/16 13:20:40 | View | Edit | Rename | Delete | History

Some actions may be disabled (not clickable) if current user does not have necessary rights. Some actions may be missing if they are not meaningful (like View Source on history page).

Viewing page which does not exist opens page editor.

Login Process

HTTP Basic Auth is used for login. When user is already logged in, it is possible to log out by cancelling login action (works only in browsers which throw credentials away if login process is cancelled).

User Rights

Everyone can view everything, only logged user can edit and delete pages and only administrator can create and delete users. Logged user can change its own password, admin can change passwords of all users.

By changing settings in userdefs.php anonymous users may be switched off and non-admins may not be allowed to edit pages.

Page Editing

Page names are case sensitive (even names of special and user pages). Range of characters permitted in page name depends on storage, generally space, alphabetical characters, digits, comma (","), apostrophe ("'") and quotation marks (""") are allowed. Note that even though page names are treated as case sensitive by generic code, storage may treat them as case insensitive, so having two pages differing in name case may result in strange behaviour.

Namespaces

Pages are organized in hierarchical namespaces. Namespaces are delimited by slash ("/"), namespace MW (case-insensitive) is reserved for internal usage and pages within it may be edited only by administrator. It is permitted to have page with the same name as some namespace.

There are special namespaces Special, Upload, Data and Image which are not listed alongside the ordinary namespaces. They are more of a prefix than namespace.

Wiki Markup

Wiki source is divided into blocks separated by blank lines. Block can be: normal, heading, list or horizontal rule. In addition text surrounded by <pre>, </pre> (each starts on its own line) is not rendered as Wiki markup and is shown as-is inside HTML <pre>...</pre> with escaped HTML-problematic characters.

Normal Block

Normal blocks are rendered as paragraph (<p>...</p>). Block content is inline processed.

Inline processing replaces strong text, emphasized text, Main Page (internal link), internal link with overridden title, link to heading block in current page, link to heading block in specific page, link to specific version, http://php.net (external link), external link with overridden title and line
break.

Source:

Inline processing replaces '''strong text''', ''emphasized text'', [[Main Page]] (internal link),
[[Main Page|internal link with overridden title]],
[[#List_Block|link to heading block in current page]],
[[User's Guide#List_Block|link to heading block in specific page]],
[[User's Guide$1|link to specific version]],
[http://php.net] (external link),
[http://php.net external link with overridden title] and line<br>break.
Boxes

Boxes are rendered as <div>...</div>.

<box class1>This box will be <div class="class1">.</box>

<box #id1>This box will be <div id="id1">.</box>
This box will be <div class="class1">.
This box will be <div id="id1">.

Heading Block

Heading block is heading title surrounded with series of "=" which indicates heading level and is rendered as <h?>...</h?>. Heading title is inline processed. Heading level 1 should not be used, because it is used for page name in header.

Heading example:

Heading level 5

Source:

===== Heading level 5 =====

List Block

List block consists of list items. Each list item starts with series of "*" and ends before another list item or with end of block. Items may span multiple lines and are inline processed. Number of "*" indicates list item level. List block is rendered as <ul>...</ul>, list item as <li>...</li>. Nested lists are possible (list items may have arbitrary level).

List block example:

Source:

* item 1
* item 1
** item 2
continues on next line
*** item 3
** item 2
* item 1

Horizontal Rule Block

Horizontal rule block must consist of exactly three dashes:

---

And is rendered as:


Directives

Directives start on new line and look like:

#NAME PARAMETER...

There is no space between number sign and name. If there is space, whole line is considered comment and is left out from output.

Unless stated otherwise variable expansion (using $variable syntax) does not work for directives.

#TITLE

Directive #TITLE changes title of current page:

 #TITLE New Title

Changing title in included page does not affect original page.

#NOTOC

Directive #NOTOC disables TOC generation.

#REDIRECT

Directive #REDIRECT allows to redirect from one page to another.

 #REDIRECT [[Some Page]]

Included pages are not redirected (this may change in the future).

Flow Control (A)
 #IF value
   processed if value is not empty
 #ENDIF

 #IFEMPTY value
   processed if value is empty (= there is no value)
 #ENDIF

 #FOREACH array_variable_name index_variable_name
   processed for each value from array variable with index variable set to it
 #ENDFOR

Values in #IF and #IFEMPTY have variables expanded.

Layout Rendering Support (A)
 #PAGE
   HTML page start
 #HEADER
   start of HTML <head> section
 #META name value
   set meta value
 #ENDHEADER
  end of HTML <head> section
 #ENDPAGE
   HTML page end

Value in #META have variables expanded.

Available #META names:

Page Attributes (A)

Directive #ATTR will set page attribute which can be later read with wiki function page_attr.

 #ATTR name value

Directives #TITLE and #REDIRECT are also projected as page attributes title and redirect.

Setting page attribute in included page does not affect original page.

Simple Forms Support (A)

Syntax is simple:

  <form METHOD URL>
    <form-field NAME TYPE PARAMETER>
    ...
  </form>

Forms are processed as inline markup.

Example with search on freshmeat.net:

  <form get http://freshmeat.net/search/>
    <form-field q text>
    <form-field # submit Freshmeat Search>
  </form>

Shows like this:

Page Inclusion (A)

Page inclusion is supported with this syntax:

{{PAGE|VARIABLE|VALUE|...}}

Example of Main Page inclusion (horizontal rules were added by this page, not by inclusion mechanism):


Welcome to miniWiki version 0.3.1, simple Wiki written in PHP which uses MySQL as its storage. It is intended for single user or small group of users (without anonymous editors) on a site with low or medium traffic.

The current version is 0.3.1 (What's new, Download).

For more information on miniWiki see User's Guide. For more information on miniWiki development see Developer's Guide.

Project is maintained by Štěpán Roh. Send your questions, requests, bugs or patches to the miniwiki-general mailing list.

This project is listed on freshmeat.net and WikiMatrix.


Special pages


Variable expansion ($variable syntax) works for all parts (including page name). If some variables are set in inclusion call, they are valid only during inclusion, not afterwards.

Wiki Functions (A)

So-called Wiki functions may be called with:

{{&FUNCTION|PARAMETER|...}}

Variable expansion ($variable syntax) works for all parts (excluding function name).

Standard set of functions:

Wiki functions are inline processed.

Wiki Variables (A)

Variables are printed with:

{{$VARIABLE}}

Pre-defined variables:

Wiki variables are inline processed.

Actions (A)

Available actions:

Table of Contents

On top of each page, table of contents is generated from all headings (unless switched off with directive #NOTOC).

Editor

Editor consists of toolbar on top, textarea with page source in the middle and edit message text field and "Preview" and "Update Page" buttons at the bottom.

No changes are done unless "Update Page" button is activated. Edit message is not mandatory.

Toolbar works only if JavaScript is enabled. When toolbar button is activated, some text is added at current cursor position and cursor is placed to edit spot. Buttons from left to right (refer to Wiki Markup chapter for more information):

What access key really means depends on web browser (e.g. Mozilla Firefox exposes it as shortcut Alt-key).

Special Pages

There are several special pages (from namespace "Special") which are dynamically created and so called user pages (with prefix "User") which have mixed content.

Special/SpecialPages

Special/SpecialPages provides list of all available special pages.

Special/Pages

Special/Pages provides list of all stored pages (including user pages with content).

Special/Users

Special/Users provides list of all users where each name leads to associated user page.

If current user has enough privileges it can create new users and delete existing ones. Deleting user does not delete its user page.

Created user has disabled login until its password is changed from its user page.

User Page

User page (like User/admin) is editable page with user information. It always exists, but may have no content. Associated user may not exist.

If current user has enough privileges it can change associated user's password.

Special/Uploads

Special/Uploads provides list of all uploaded files and also a mean to upload new ones. Name of uploaded files lead to associated upload page.

Unlike other Wikis, miniWiki stores uploaded files in a same storage as normal pages.

Upload Page

Upload page (with prefix "Upload:") represents one uploaded file. Edit link allows to upload new version of a file.

Upload Data Page

Upload data page (from namespace "data") is not a real page, it returns raw content of an uploaded file.

Upload Image Page

Upload image page (with prefix "Image:") is not a real page, when linked uploaded file is shown inlined as an image.

Special/Info

Information on miniWiki and all enabled extensions (both core and non-core).

Secrets of MW Namespace (A)

Non-core Extensions

Extensions (core and non-core) can be enabled or disabled in userdefs.php with variable mw_enabled_EXTENSION_CLASS set to true or false.

User Info (A)

One function called user_info is provided which loads and renders Wiki markup stored in a file users/CURRENT_USER_NAME (location is configurable in userdefs.php).

Extension class is MW_UserInfoExtension. Disabled by default (was enabled prior to version 0.3.1).

Available Storages (A)

MySQL

Extension class is MW_CoreMySQLStorageExtension. Enabled by default.

Filesystem

Experimental storage. Does not support revisions. Pages and uploads are stored in the same directory called pages, namespaces are mirrored as directories. Wiki pages have .wiki suffix.

Extension class is MW_CoreFilesystemStorageExtension. Disabled by default.

Maintenance (A)

Install/update

See README.

Import/export

Two command-line scripts are available: import.php and export.php. Run them without arguments to see the help.

SourceForge.net Logo