Description

Creole is an initiative to bring a common basic set of wiki markup to different wiki engines. The Creole 0.3 Specs (2006-12-19) are very close to the syntax used by DokuWiki. Only those elements differ:

This Plugin will interpret Creole elements that are not understood by DokuWiki. If the markup collides (as with the header level order), by default DokuWiki's standard markup takes precedence.1) With the exception of the changed behaviour for linebreaks, all your existing wiki pages will look the same.

Reverse Headings

In Creole, the header ordering is just the other way round. If you have set the markup precedence option to DokuWiki (default), this plugin will assume headers are DokuWiki style if there are equal signs after the title. In Creole, closing (right-side) equal signs are optional. So if you omit them, headers are interpreted as Creole.

Level 1

Level 2

Level 3

Level 4

Level 5

Linebreaks

DokuWiki and Creole 1.0 do not care about (single) line breaks. Creole 0.3, however, does treat line breaks in the source as line breaks in the output.
This component is mainly the same as Chris Smith's linebreak plugin. Thanks!

Previous versions of this plugin matched Creole 0.3 and so linebreaks were kept as linebreaks. From now on, linebreaks will be replaced by whitespace to match Creole 1.0. The config option linebreak can be set to Linebreak to switch back to the Creole 0.3 behaviour and keep the linebreaks.

Todo

make toolbar work

update to Creole 1.0 specs (work in progress)

…but there must be a conf option to change linebreaks between Creole 0.3 and 1.0. Done.

Discussion

Very nice! The image notation in the Creole Markup however conflicts with the syntax for plugins in DokuWiki. If DokuWiki is planning to change at some point in time to Creole, it might be wise to switch to the proposed 'internal markup' style «x» for plugins. For anyone to use this plugin, a modification of the toolbar would be needed; do I have to change the toolbar manually or could the plugin be able to override the inserted syntax? Also, is there any converter for existing wiki pages?
— Niklas 2006-12-19 09:16

I don't know if a plugin can override the toolbar code, but I hard-coded reversed headings some time ago using these tips. With the Creole plugin installed, all you have to change is the headings section in toolbar.php (to get an idea: look here.
As for the converter: I once thought about writing a little script, but then decided to make it by hand. But if you want to do so. It should be relatively easy: Just go trough the text of each of your pages (with old syntax) and replace each occurrence of a headline with a unique symbol (like '======' → 'XXXH1XXX', '=====' → 'XXXH2XXX' …). Then you go through the text again and replace your unique identifiers with the new syntax ('XXXH1XXX' → '==', 'XXXH2XXX → '===' …). By going through the text twice, you avoid conflicts of old and new headline syntax.
As for the other syntax changes: You don't have to change anything, as DW understands both old and new syntax for lists and no-wiki. — konstantin baierer 2006-12-19 15:47

Good point about the replacement. The reverse header tags page is only semi-useful to me: I really don't want to patch a single line of code, I only want to use plugins that can be installed via the plugin manager. The reason is that even though I am setting up the wiki and hacking around is no problem at all, I won't be the one maintaining it in the future, so I should and will not assume that the future maintainer will be able to cope with actual source code. Niklas 2006-12-19 23:32

Hi Niklas and Konstantin. With an additional event hook in inc/toolbar.php, it would finally be possible for plugins to modify the toolbar. Let's ask Andi and the other developers whether they are open for this idea. — Esther Brunner 2006-12-20 00:53

As I had to make a fresh installation today, I wrote that script mentioned above in Perl. It reverses all header tags from DokuWiki to Creole notation for a file given as argument.

The original file is overwritten, a backup is made to oldname.BAK.
If you want to convert a single file, just type perl revheaders FILENAME. To rename a whole directory, go to the base of it and type find . -regex '.*txt' | xargs perl revheaders. That will convert all .txt-files in this and all subsequent folders. If you want to undo your changes, just run the script again with the same file(s). It's especially useful to mass rename the built-in wiki pages in /inc/lang/. — konstantin baierer 2007-03-31 22:27

Wanted to point out that going to Creole 1.0 is not a big leap. I wrote a couple additions for the Creole 1.0 Additions of subscript ( ,, )and strikeout ( – ). Took a couple minutes, can't get superscript to work ( ^^ ) regardless of sort, always get intercepted as a table. even updated the toolbar to support the new syntax. – Brian Hartvigsen 2008-02-23 13:27

I actually got superscript and the new table header syntax working. The later is probably a dirty hack, but it works – Brian Hartvigsen 2008-02-23 13:27

A big thank you to all of you who have created and maintained this plugin. It provides me interoperability with WordPress where I use the BlogText Creole markup plugin. I have enhanced the Creole DokuWiki code running on my computer and would like to share what I have done. Perhaps what I have done, or something like it, could become a part of the standard release.

I enhanced the plugin to support this sort of syntax that I often use (example):

Host file setup:
# **Desktop Link to Hosts File.** Log in as the Administrator OS user, bring up a Cygwin command window to create a link to the hosts file using the following commands: {{{
cd /cygdrive/c/Users/Administrator/Desktop/
ln -T /cygdrive/c/Windows/System32/drivers/etc/hosts hosts.txt
}}}
# **Add Mac host to hosts file.** Still logged in as the Administrator OS user, add the following line to the hosts file using the hosts.txt desktop link: {{{
10.180.15.2 mymac
}}}

I enhanced the plugin to switch to block mode for an inline nowiki section that ends with three braces immediately after a newline. Regular inline mode takes precedence - the switch to block mode only happens if there is no normal (i.e., not right after a newline) set of end braces.

Here are the changes:

(1) In preinline.php, only match entry if there is no newline before the terminating braces - I added the [^\n] construct. Here is the connectTo function with that small change:

Creole conflicts with fckglite

I just learned the hard way, that the creole plugin conflicts with the wysiwyg editor plugin fckglite. If creole is installed, fckglite refuses to save. Depending on circumstance, the section to be edited gets deleted. There are no error messages in /var/log/apache/error.log . Apparently, creole does not even have to be enabled to produce this failures. kmk 2012-09-17 20:05