This is an old revision of the document!


DokuWiki Server

This guide is for installation instructions of a DokuWiki private site, or a DokuWiki help server for a Joomla 3.9 website installation and help pages served by DokuWiki. This is specific for my personal needs, but might help you in setting up a highly customized dokuwiki server instance.

Installation

  1. Go to Download DokuWiki and configure your download to include:
    • Version: stable
    • Languages: en, de, fr, ko, th
    • Popular Plugins: CAPTCHA, Upgrade, Wrap, Translation.
    • For a general purpose server, add Popular Plugins: Video Share, Gallery.
  2. Unzip the download to your web server directory, then run /path/to/wiki/install.php
  3. Install bethico template for DokuWiki
  4. Install the Icons Plugin for FontAwesome icons
  5. Install the condition Plugin
  6. Install the Include Plugin
  7. Install the date Plugin
  8. Install the TocTweak Plugin

General Purpose Server

  1. Install sqlite Plugin (required for Calendar Plugin)
  2. Install davcal Plugin (Calendar Plugin with CalDAV sharing support)
  3. FIXME hover css and icon links to websites

FIXME

  1. Google Maps Plugingrep -r “<html” and remove all <html> tags, disable html
  2. color Plugingrep -r “<color” and replace with wrap plugin

Settings

  • Add “admin” group for every administrator of the help server in User Manager.
  • Create the language namespaces (e.g. en, fr, de, ko, th) and set permissions to Read only for @ALL in Access Control List Management
  • Set “Use first heading for pagenames” to Always under Display in DokuWiki's Configuration Settings.
  • Set “Top level for table of contents=2”, “Minimum amount of headlines that determines whether the TOC is built=1”, “Maximum level for table of contents=4”, and “Maximum section edit level=4” under Display in DokuWiki's Configuration Settings.
  • Uncheck icon libraries other than FontAwesome from Icons plugin configuration in DokuWiki's Configuration Settings.
  • Add “_blank” to “Target window for external links” and “Target window for media links” under Links in DokuWiki's Configuration Settings.

Customization

There are a few core hacks required to make this work as a help server, but they are simple and thus easy to maintain, even after an update of DokuWiki or any of the extensions.

  • Copy 'doku.php' to 'help.php' in the DokuWiki root folder
  • Create the language fallback to English for non-existent translation pages by adding 3 lines to /help.php at line #41, just below '$ID = getID();'. Remember to update after you add or remove languages.
    // bco: 20181114. Get requested language and set language fallback
    require_once(template('dispatcher.php'));
    $langcode = help_language();
  • Modify 'help.php' and replace line #119+4 and #120+4
    //do the work (picks up what to do from global env)
    act_dispatch();

    with

    // bco: 20181114. Set language and load act_dispatch override
    init_lang($langcode);
    help_dispatch();
  • Modify '/inc/template.php' and add after line #130 ($toc = $TOC) in function tpl_toc
    // bco: 20181116. Fix toc issues due to use of condition Plugin
    require_once(template('dispatcher.php'));
    help_toc($toc);
  • After a DokuWiki upgrade make sure that
    • If '/inc/actions.php' has been upgraded, reflect the changes in '/lib/tpl/bethico/dispatcher.php'
    • If '/inc/template.php' has been upgraded, reflect the changes in function tpl_toc
    • If '/doku.php' has been upgraded, reflect the changes in '/help.php'
  • If you use a template other than 'bethico', you must copy '/lib/tpl/bethico/css/userstyle.css' to '/conf'
  • Optional: replace favicon and logo in '/lib/tpl/bethico/images/'.

The following files must be checked against the previous version after upgrading

File DokuWiki File Todo
help.php doku.php line 12: $updateVersion and verify content (compare doku.php to previous version)
inc/template.php inc/template.php line 131-133: call to help_toc in function tpl_toc
lib/tpl/bethico/dispatcher.php inc/actions.php verify function help_dispatch

Joomla Access

  • Set the Help URL in the component configuration of com_bethico to
    'https://your.wiki.server/help.php?id={langcode}:{keyref}'
  • Add a help button to view 'view' to open the help page
    JToolbarHelper::help('view', true);
  • With English as the active language it will invoke
    https://your.wiki.server/help.php?id=en:view

Help system

Joomla's default help url:

url example: https://help.joomla.org/proxy?keyref=Help{major}{minor}:{keyref}&lang={langcode}

Substitute tags:

Tag Name Example
{app} Application name 'Administrator'
{component} Component name 'com_content'
{keyref} Help screen key reference JToolbarHelper::help('{keyref}', true)
{language} Full language code 'en-GB'
{langcode} Short language code 'en'
{langregion} Region code 'GB'
{major} Joomla major version number
{minor} Joomla minor version number
{maintenance} Joomla maintenance version number

Upgrade to Version 2020-07-29 "Hogfather"

Plugin whoisonline

  1. Replace function handle($match, $state, $pos, &$handler) definition with function handle($match, $state, $pos, Doku_Handler $handler) in file lib/plugins/whoisonline/syntax.php
  2. Replace function render($mode, &$renderer, $data) definition with function render($mode, Doku_Renderer $renderer, $data) in file lib/plugins/whoisonline/syntax.php
  3. Set $conf['defer_js']=0; in file conf/dokuwiki.php

Todo: change menu system

PHP 8.1 issues

Plugin condition

  • Replace curly brackets string indices with square brackets in line 84 and 149 of plugins/condition/syntax.php if you run your webserver with PHP 8.

Plugin html5video

  • Put brackets enclosing the expressions on line 190 and 191 of plugins/html5video/syntax/video.php if you run your webserver with PHP 8.