DidiWiki

See below: Rules for editing a wiki page
DidiWiki 0.5
==============

DidiWiki is a small and simple WikiWikiWeb implementation written in
C. Its intended for personal use for notes, Todo's etc. It includes its
own webserver and hopefully its as simple as just compiling, running
and pointing your browser at it.

Installation
============

To build do the usage ./configure and make. You can then make install or
run DidiWiki right from the src dir. On startup it'll tell you the address
to point your browser at. You should then be ready to go.

If upgrading from an earlier version its a good idea to delete
~/.didiwiki/DidiHelp before running so you get the latest version of
the help file.


Remote API
==========

As from 0.5 DidiWiki has a very simple 'REST' like http api. Hopefully
this will make it possible to write alternate front ends to didiwiki.

The api looks like this with parameter passable via GET or POST;

http://didiwiki/api/page/get?page=XXX

Get the raw wiki text for specified page. Returns http 500 code if
page does not exist.

http://didiwiki/api/page/set?page=XXX&text=XXX

Set the wikitext of a page. Page is created if it doesn't exist.

http://didiwiki/api/page/exists?page=XXX

Returns 'success' if page exists, 500 error if not.

http://didiwiki/api/page/delete?page=XXX

Deletes a page.

http://didiwiki/api/pages

Returns a seperated list ( one entry per line containing page
title,TAB,modified date) of wiki pages with the most recently modified
first.

http://didiwiki/api/search?expr=XXX

Like the above but lists only pages which contain 'expr'


Notes & Excuses
===============

- If you want to contribute, please check the TODO !

- Pages are stored in ~/.didiwiki ( you can override this by setting
'DIDIWIKIHOME' env var to a valid path. ). You can add a styles.css
to this directory to override the 'inbuilt' stylesheet.

- The webserver part is heavily based on cvstrac's internal server,
following the same kind of process;

- Its a pretty simple lightweight forking server. A child process is
forked to handle each http request.

- These forked children are assumed to not be around for very long (
less than a second ), thus no real attempt is made to free up
memory in these child processes.

- Its probably not very secure at all. !!PLEASE DONT RUN AS ROOT!!

- The code uses asprintf in a couple of places. I dont know how portable
this is to non Linux systems. If its a problem to you Feel free to send
patches.

- You can debug segv's by running like 'didiwiki debug' which will not
start the http server, it existing in a single process but expecting the
http request on stdin.

- The formatting style is very similar to that of kwiki's - I just like
kwiki :-)

- I wrote it in C as I've mostly forgotten Python, Perl etc
( and I wanted it to fit easily on a PDA ).



Rules for editing a wiki page

Extracted from the kwiki website.
This describes the wiki markup language used by this kwiki.


Notes


Level 1 Heading (H1)

= Level 1 Heading (H1)

.


Level 2 Heading (H2)

== Level 2 Heading (H2)

.


Level 3 Heading (H3)

=== Level 3 Heading (H3)

.


Level 4 Heading (H4)

==== Level 4 Heading (H4)

.


Level 5 Heading (H5)
===== Level 5 Heading (H5)

.


Level 6 Heading (H6)
====== Level 6 Heading (H6)

.


The horizontal lines in this page are made with 4 or more dashes:

----

.


Paragraphs are separated by a blank line.

Like this. Another paragraph.

Paragraphs are separated by a blank line.

Like this. Another paragraph.

.


Bold text, italic text, and underscore text.

*Bold text*, /italic text/, and _underscore text_.

Combination of bold and italics

/*Combination of bold and italics*/

. Inline code like /etc/passwd or CGI::Kwiki

Inline code like [=/etc/passwd] or [=CGI::Kwiki]

. Strikethrough

-Strikethrough-

.


WikiLinks are formed by two or more words in camel-case.

WikiLinks are formed by two or more words in /camel-case/.

External links begin with http://, like http://www.freepan.org

External links begin with http://, like http://www.freepan.org

On some cases links can appear as <spam://.> This means that you entered an address that is not whitelisted. Wait for an admin to whitelist it.

Forced wiki links are a alphanumeric string surrounded by square brackets.

Forced wiki [links] are a alphanumeric string surrounded by square brackets.

Named http links have text with an http: link inside, like FreePAN Site

Named http links have text with an http:// link inside, like [FreePAN http://www.freepan.org Site]

Sometimes WordsShouldNotMakeAWikiLink so put a '!' beforehand.

Sometimes !WordsShouldNotMakeAWikiLink so put a '!' beforehand.

Same thing with http://foobar.com

Same thing with !http://foobar.com

Mailto links are just email addresses like foo@bar.com.

Mailto links are just email addresses like foo@bar.com.

.


Links to images display the image:


http://www.google.com/images/logo.gif

.


Unordered lists begin with a '* '. The number of asterisks determines the level:

* foo
* bar
** boom
** bam
* baz

.


Ordered lists begin with a '0 ' (zero):

  1. foo
  2. bar
    1. boom
    2. bam
  3. baz
0 foo
0 bar
00 boom
00 bam
0 baz

.


You can mix lists too:

* Today:
00 Eat icecream
00 Buy a pony
* Tomorrow:
00 Eat more icecream
00 Buy another pony

.

This feature no longer works correctly in Kwiki >0.31. Notice that this produces two unordered lists at the top level, instead of one. –MattHoward


Any text that does not begin in the first column is rendered as preformatted text.

foo   bar
x y
1 2

.


You can comment out wiki-text with '# ' at the beginning of a line. This will make the text an html comment:

# These lines have been # commented out
# These lines have been 
# commented out

.

This feature no longer works correctly in Kwiki >0.31. Not much to say, it just doesn't work. –MattHoward


Simple Tables:


Dick Jane
height 72" 65"
weight 130lbs 150lbs
|        | Dick   | Jane |
| height | 72" | 65" |
| weight | 130lbs | 150lbs |

Inline HTML is escaped.

<hr> <bold>No?</bold> <i>Yes?</i> <hr/>

Renders as: <hr> <bold>No?</bold> <i>Yes?<i> <hr>

Notice the '/' character in the tags is being rendered as italic markers.


To prevent IE6 from rendering pages that contain preformatted text wrong, add a dot after each preformatted text block like I have done in this page. This is a temporary work-around, until the bug reported by MichaelIvey at BugReports is fixed. – DennieReniers