This is a plugin for DokuWiki. This plugin creates a static HTML version of your DokuWiki website. The static version will be browseable offline, i.e. without a connection to the server that hosts the wiki. All internal links will still work. External links will be preserved, so they will function when you are online again.
This way you can take your entire DokuWiki website with you and read it on your mobile phone, pda and others1).
See download section for available versions.
In addition, Dokuwiki Offline Plugin relies on two external programs:
Operating Systems
More of an academical nature, but they should be mentioned here.
. So, anybody who has access to the config file will be able to see these credentials.offline_plugin.zip (~38 kB)
Though this plugin has been tested thoroughly I have to mention the usual disclaimer:
So for the brave ones: Make sure you have these two additional programs installed. They not come with your DokuWiki installation or your web server but depending on the operating system you are using the might already be installed.
offline_plugin.zip
into your plugin directory.offline
beneath your lib/plugins/
directory.tmp
in your data
directory:data/tmp
tmp
directory is writable by the web server.chmod 777 data/tmp
To configure the plugin's behaviour enter the admin panel and then click on configuration.
Before you run the Offline Plugin for the first time you should make sure that the pats to wget and zip are correct.
Protocol prefix ('http' or 'https').
In most of the cases this is 'http'. Only if your website's HTTP traffic is encrypted by method of an SSL certificate you have to choose 'https'.
The name of the server on which DokuWiki is hosted.
Example:
For 'http://www.ocean-dreams.com/categories/octogarden/' this would be 'www.ocean-dreams.com
'.
The relative path from your web server's docroot to the DokuWiki installation (do no use leading or traling (back-) slashes)!).
Example:
For 'http://www.ocean-dreams.com/categories/octogarden/' this would be 'categories/octogarden
'.
Please note that '/categories/octogarden
', 'categories/octogarden/
' or '/categories/octogarden/
' would be wrong.
Path to executable wget file.
Of course this depends on your server's configuration and differs. This could be something like /opt/local/bin/wget
on Unix-like machines or E:\programme\GnuWin32\bin\wget.exe
on Windows. On Linux or modern Macs you can use the commands which wget
or locate wget
to find out where your wget installation resides.
If your are not sure about the path you can use the helper program
http://YOUR-SERVER/YOUR-DOKUWIKI-NAME/lib/plugins/offline/which_binaries.php
This is what the output could look like:
Program | Path to binary |
---|---|
wget | /opt/local/bin/wget |
Path to executable archiver file (e.g. '/usr/bin/zip').
This is what the output could look like:
Program | Path to binary |
---|---|
zip | /usr/bin/zip |
bzip | Not installed. |
gzip | /usr/bin/zip |
rar | Not installed. |
tar | /usr/bin/zip |
Create log file (slows backup down. Only recommended if errors occur while creating offline version).
You can either use the plugin right away as it comes out of the box or you can simulate the creation of a static html version.
You can trigger the creation of an offline version in two ways:
Either execute the script via browser or run the script via cron job.
http://YOUR-SERVER/YOUR-DOKUWIKI-NAME/lib/plugins/offline/create.php
00 20 * * * (wget http://YOUR-SERVER/YOUR-DOKUWIKI-NAME/lib/plugins/offline/create.php)
00 20 * * * (wget --http-user="USERNAME" --http-passwd="PASSWORD" http://YOUR-SERVER/YOUR-DOKUWIKI-NAME/lib/plugins/offline/create.php)
http://YOUR-SERVER/YOUR-DOKUWIKI-NAME/lib/plugin/offline/offline.zip
If you are anxious about accidently deleting data on your server by using this plugin you can use the dryrun option.
Just call the script create.php
with the following parameter and value offlineMode=dryrun for example:
http://YOUR-SERVER/YOUR-DOKUWIKI-NAME/lib/plugins/offline/create.php?offlineMode=dryrun
The parameter can be added to the URL in both of the above mentioned invocation methods:
It makes no difference whether the script is called via browser or via cron job.
In dryrun mode the script create.php
simulates the whole offline version creation process.
In addition debugging information will be output only to the screen.
Neither files or directories are being created, renamed, archived or deleted.
You can take your time and examine all actions performed by the plugin in detail. You can check paths, file names and the like. Finally, when you feel comfortable with the plugin's behaviour, you can call the script without the parameter offlineMode.
Your offline version will use the following directory hierarchy:
/offline +- pages +- media +- css +- index | +- alphabetical.html +- index.html
You can start browsing it by opening the file index.html
in the root directory of the folder offline
.
I coded this plugin in my spare time and for my purposes. Since I do appreciate Andreas Gohr's work very much and since I know that other people did also did ask for an offline plugin I provide it to you without asking for money. But, please understand that I cannot provide support of any kind. Of course I will try to fix bugs as soon as possible.
For discussion, hints and critic please use the plugin page
http://www.dokuwiki.org/plugin:offline
Thanks to Robert Peake for suggesting a recursive directory retrieval function (see source code for further details)