Gakowi syntax

by Martin Monperrus

The syntax of gakowiki is a wiki syntax inspired from the syntax of dokuwiki.
Here is a demonstration:

Demo

BeforeAfter
=====Basics=====
DokuWiki supports **bold**, //italic//, and ''monospaced'' texts. 
Of course you can **''combine''** all these, and use them **across 

line breaks**.

**Paragraphs** are created from blank lines. 

<pre>
//Code in pre mode, **this is bold, yet not interpreted**
int i = j+1;
</pre>

^^you can wrap lines as in

 HTML 
with many            spaces and linebreaks with **carets**^^

<!-- Comments disappear from the resulting string -->

==== Links ====
DokuWiki supports multiple ways of creating links.
Simply use brackets to create local or absolute links: 
[[gakowiki]], [[http://www.google.com]]. 

You can set the link text as well:
 [[http://www.google.com|This link points to google]]. 

=====Heading translated to &lt;h2>=====
====Heading translated to &lt;h3>====

Basics

DokuWiki supports bold, italic, and monospaced texts.
Of course you can combine all these, and use them across

line breaks
.

Paragraphs are created from blank lines.

//Code in pre mode, **this is bold, yet not interpreted**
int i = j+1;
you can wrap lines as in HTML with many spaces and linebreaks with carets

Links

DokuWiki supports multiple ways of creating links.
Simply use brackets to create local or absolute links:
gakowiki, http://www.google.com.

You can set the link text as well:
This link points to google.

Heading translated to <h2>

Heading translated to <h3>

Usage

You may download gakowiki-syntax.php.txt and use it as follows:
require_once( 'gakowiki-syntax.php' );
global $parser;
$parser = create_wiki_parser();
echo $parser->parse('hhjjh **kkk** ');
// or 
echo gk_wiki2html('hhjjh **kkk** ');