Flangy > Software Development > Python TikiWiki

Work in progress.

Python TikiWiki

Download: tikiwiki.zip

This code implements Wiki-style editing in Python, using the file system as the datastore.

Page links are created by place [text in brackets]. \ is used as the escape character; any character following \ will appear in the page. Thus, \[ lets a bracket be output to the page.

Wiki nodes can store name-value pairs in addition to the body text block. These pairs appear at the top of the file before the body text. A pair looks like \"name: value\", one pair to a line.

title: Living Room
bgcolor: #336699

[Brackets make links to pages]

This page would have information about my living room on it.

Pages are rendered through a Template system. Name-value pairs turn into variables in the template. The body text becomes the template variable \"body\". Python expressions and template variables can appear in curly braces.

<castle:template name="home">
<h3>{title}</h3>
{body}
</castle:template>

The idea for this code is that you'd be able to create new sections in the site which would be treated like folders (originally I was going to call them castles for some reason.) A castle could have default values set, such as what template to use to render pages. You'll be able to make navigation templates for specific templates. So you'd be able to make a page for each room in your apartment, with photos, set an ordering for the pages, then have the castle's navigation update when you add new rooms to the site.