It's better when it's simple

User Tools

Site Tools


Dokukiwix Plugin

Compatible with DokuWiki


plugin Generates a static HTML, offline browseable version of your Wiki

Last updated on

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to offline, siteexport

Tagged with export, html

Details and Download Archived on 13-Jan-2020


Dokukiwix is a plugin for DokuWiki, a powerful file-based Wiki engine. It allows you to generate a static HTML version of your wiki, so that your users can download it and then browse your wiki while being offline. The name Dokukiwix comes from DokuWiki, and Kiwix, a XUL-based browser, working on Gnu/Linux, Mac and Windows, developed by the french company Linterweb. It will allow you to add a search engine to your wiki. The actual features include:

  • Support of pictures and other internal media
  • Retrieval of external pictures
  • Generation of a hierarchical file structure corresponding to the namespaces of your wiki
  • Ability to pause/resume the html generation process.
  • A simple logging system





  • Install the plugin with the plugin manager, in the admin section.
  • Make sure the directory /lib/plugins/dokukiwix/archive is writable by the webserver.
  • Get the “offline” template, and unzip it in /lib/tpl/
  • In inc/common.php:
    function wl($id='',$more='',$abs=false,$sep='&'){
        global $conf;


    if (defined("dokukiwix_plugin")) return dokukiwix_wl($id, $more, $abs, $sep);


    function ml($id='',$more='',$direct=true,$sep='&'){
      global $conf;


      if (defined("dokukiwix_plugin")) return dokukiwix_ml($id,$more,$direct, $sep);
  • Check the settings of your PHP: if you have huge pages or pages that link to several big external pictures, you may need to raise the timeout limit or the maximal memory allowed.


  • Version 0.3:
    • Added logging textarea.
    • Added index.html file, redirecting to the real home page of the archive.
    • Improved startup code.
    • Added COPYING file, dokukiwix is under GPLv2.
    • Some minor bugfixes and cleanup.
  • Version 0.2:
    • Added locking system.
    • Pause/resume/stop buttons added
    • Improved the way wiki links are handled
    • Better file hierarchy
  • Version 0.1:
    • Initial version

Known bugs

None yet. Please contact me if you encounter some.


The change from offlineVersionPath to archivePath is required for version 0.3 to work, otherwise the images are saved in the images directory of the plugin
instead of the archive. Also it only successfully retrieves the images if the cache has to be refreshed, hence the instruction to set the cache time
to 1 before running it.
Is there any way to fix the plugin so that images will be retrieved without the cache refresh? Since it works by intercepting the wl and ml functions
I have no idea if its possible.
Also is there any way this plugin can be modified to work outside of a browser? E.g. from cron job…

After making the changes described below the plugin works fine on MacOSX. It does not work with the Safari browser however, recent versions of Firefox on MacOSX seem to work just fine for creating the archive. Once the archive is created that works fine with Safari.

There is a Bug in ajax_createLock
date('Y-m-d_H:i') cause problems because of the “:” character. Windows based systems not allow “:” in filenames.
Better use date('Y-m-d_H-i')

I've noticed a cache problem with this plugin, and the later release of DokuWiki
the internal links are not replaced properly in the HTML export, unless the cachetime is set to 1 second
$conf['cachetime'] = 1;
within conf/dokuwiki.php
a more ideal solution I think would be to add
if(defined(“dokukiwix_plugin”)) clearstatcache();
somewhere in the plugin, to erase the cache, or somehow set “nocache” for the pages, but I'm not sure where / how

Does not work with Firefox 2, IE 7 is ok.

Internet Explorer 8 does not work without “compatibility view”.

Error: plugin_dokukiwix_toggle_startpause is not defined
Source File: http://yoursite/wiki/doku.php/start?do=admin&page=dokukiwix
Line: 1

Version 0.4 Issue
- does not work with Firefox 3

Error: plugin_dokukiwix_toggle_startpause is not defined
Source File: http://yoursite/wiki/doku.php/start?do=admin&page=dokukiwix
Line: 1

Note: I had to turn off nice URLs to make it work local on a Windows XP, FF system —rd

I've made following changes to version 0.3 to get it running on WindowsXP: (can't find version 0.4 for download)
Environment: Abyss Webserver X1 (v 2.5), PHP 5.2.2, DokuWiki-2008-05-05, Firefox 3.0.1

  • Install plugin as described here
  • change ajax.php
#file: lib\plugins\dokukiwix\ajax.php: (see above, no colon allowed in windows filenames)\\
org: 109           fwrite($dokukiwix_fp, date('Y-m-d_H:i'));\\
new: 109           fwrite($dokukiwix_fp, date('Y-m-d_H_i'));\\
  • change common.php ( add line 16 and 17 )
# file: lib\plugins\dokukiwix\common.php
org: 15            global $offlineVersionPath;
new: 15            global $offlineVersionPath;
     16            global $archivePath;
     17            $offlineVersionPath=$archivePath;
  • within DokuWiki admins-section set “cachetime=1” and “userewrite=none”. I've not tested, if these settings are necessary.

this plug-in do not generate correct links if you are in a directory and the link point out of that.

For example you have the following structure:


if in mydoc.txt there is a link [:start.txt], than the program generate the page:
and not

Information for Russian users of dokukiwix. На моей вики названия страниц естественно на русском языке. Если не включить полную транслитерацию в Настройках Вики (настройки отображения), то dokukiwix генерирует ссылки в виде htmlspecialchars (типа %D0%B0%D1%80%D0%BC.txt), а файлы сохраняются (DokuWiki установлена на сервере под Windows Server 2003) с совсем другими искаженными именами. Короче - включайте транслитерацию названий страниц. Если кто знает более лучшее решение – напишите пожалуйста.

With DokuWiki 2009-02-14, on a local Windows server, with Firefox 3 or MSIE6, Dokukiwix “hangs” when loading the Dokukiwix administration page. Pressing the “go” button has no effect. No pages are generated in the /archive folder. I followed the instructions: I used the offline:plugin, modified <dokuwiki_root>/inc/common.php properly. Rolf Hemmerling 2010/01/02 10:53

Wrong paths of latex plugin images in static HTML-Version

The Dokukiwix-plugin (Vers. 0.3) set the paths for images of the latex plugin in the static html-files wrongly. One can solve this inside a BASH-console (e.g. under Linux) using this:

find . -name "*.html" -exec sed -i 's!/dokuwiki/lib/exe/fetch.php?cache=&amp;media=latex%3A!./../../images/latex/!g' {}  \;
  • find . -name “*.html”: search in the current directory and all subdirectories for HTML-files
  • -exec sed -i 's: execute for all HTML-files “sed”, which substitute “/dokuwiki/lib/exe/fetch.php?cache=&amp;media=latex%3A” with “./../../images/latex/” into the existing HTML-files (“-i”)
  • {} is wild card for the current HTML-file

Make sure that the content of data/media/latex is in the images/latex directory. krause 2010/02/19 15:39

with Debian Squeeze

in ajax.php change:

if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../../').'/');


if(!defined('DOKU_INC')) define('DOKU_INC','/usr/share/dokuwiki/');

Where can I save the archive?

A better solution to generate the static site in was dokuwiki/data/media/dokukiwix-backups i.e, but why??

  1. Permissions by namespace. If you create the backup on /lib/plugins/dokukiwix/archive, everyone could see the code (if you don't put a .htaccess file there)
  2. DokuWiki farm. If you have a dokuwiki farm, maybe this arch shares plugins for all the wikis in the farm, and this is a problem due to every user could see your 'not so closed' wiki.
  3. We could generate a compressed file (TAR.GZ, ZIP, RAR) to download by media manager in the dokukiwix-backups namespace.

What do you think?

plugin/dokukiwix.txt · Last modified: 2023-04-28 20:02 by Aleksandr

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki