[dokuwiki] Re: Changind default syntax to Markdown

  • From: Christopher Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 6 Aug 2008 11:34:39 +0100


On 6 Aug 2008, at 10:08, Maciej Łebkowski wrote:

Hi all,


My goal is to change the default wiki syntax to Markdown.

I looked at render plugins, but it seems it`s not the way, so
propably I have to modify the dokiwiki code.


Any ideas where to start?


There should be no need to modify dokuwiki code.

You can also create your own suite of syntax plugins which supply the syntax required by markdown in much the same way as the creole and bbcode plugins work. If you take the time you can probably set up "accepts()" to ensure that <markdown> and all the markdown syntax can not accept any standard dokuwiki syntax.

quick tutorial :)

When ever the parser is handling a particular "syntax" its in the "mode" for that syntax. For each mode the parser has a list of allowed syntax. Normally the allowed syntax is setup pretty generically, with similar modes grouped together (e.g. formatting modes, '**','//','__', etc), but there is nothing to stop you overriding the accepts() method and selecting the modes on an individual basis.

The accepted modes are used to generate the regular expression that dokuwiki uses when inside a particular mode. So, if you haven't accepted the table mode or the underline mode their syntax won't be in the regular expression and so the parser will ignore the triggering character combinations.

</tutorial>

If you wish to disable standard dokuwiki syntax, create a syntax plugin to match the syntax and give it a lower sort number than the standard syntax. The plugin will then process that particular syntax and you can do what you want with it, e.g. simply echo the characters unfiltered into the rendered page.

- Chris

--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: