How DokuWiki works: wiki markup is read by a parser which returns instructions. These instructions are processed by a renderer to produce some HTML code.
Just for reference, an instruction looks like that:
Array ( [0] => internallink [1] => Array ( [0] => java:spring:hello_world [1] => Hello World ) [2] => 150 )
Instead of redoing the same process at each user request, DokuWiki has a powerful multi-level caching system. By using it, we can just get the cached instructions, and process them with a custom renderer to generate our own HTML code (with links to our PHP pages, not DokuWiki urls).
Download it here. File hierarchy
The index page contains several links to doc.php, which directly uses data files from the dokuwiki folder (a standard dokuwiki installation). DokuWikiRendererXHTML.php is a custom renderer (overrides some methods of DokuWiki's default HTML renderer).
doc.php, under // init renderer:$renderer->notoc();