Swank Wiki
Recently Visited

Swank v0.04.04

Overview: What is Swank?

Swank is a Structured Wiki.

All pages in the wiki have a structure.  By structure, we mean it is like a database record, with fields and values.  Pages are not just unstructured text, like normal wikis.

The default structure is a single field named "wiki" which is a big wysiwyg-edited unstructured text field.  So we are back where we started, but with one critical difference: we now have the option to do a completely different structure.

Templates or Types

The structure of a page is defined by a "template" or "type" page, which is itself a simple wiki page.  The template defines what the page will look like, what fields are on the page, where they will  be displayed, and what types of values are stored in the fields.

When a page is requested, the page itself is not actually displayed.  Instead, its template page is executed, and the values from the page are displayed appropriately by the template.

Full discussion of request handling...

Actions or Methods

When we say above that the template page is "executed" we mean that it is actually compiled into a subroutine or method and executed.  Pages have method calls and executable code embedded inside special tags.  If a field with no tags is executed, it simply returns its value, so every value is considered to be an executable method.

Pages inherit methods from their template page, which is why it is also called a "type".  Each page is represented by an object internally.  This means that Swank is also a powerful web application development platform.

Certain methods are available for outside requests, and so they are also called actions.  When you request "/page.html", you are really just calling the html method on the page object.  When you want to edit the page, you request "/page.edit" to call the edit method.  And when you want to submit updates to the page, you send them to the submit method by posting to "/page.submit".

Fields and Values

Values on a page can be of various types.  These types are defined by the field used to edit and display the value.  Fields are defined by a particular type of page, which knows how to display a value for normal viewing, how to display a value for editing, and how to validate and save a value when the page is updated.