Customizing DokuWiki

I wanted to set up a private wiki on my webhost and after surveying the wiki landscape I chose DokuWiki. This post will collect my ongoing experiences with it as I fix problems and customize it to my liking.

DokuWiki Installation

Installation was straightforward:

  1. In the webhost’s cPanel, create a subdomain for the wiki and pick the root folder
  2. In cPanel Softaculous App Installer, find DokuWiki, supply the domain and folder info, and install

DokuWiki Experiences

(1/30/22) I have been using DokuWiki for a little while and the base package works okay, but plugins are a mixed bag. None of the WYSIWYG editor plugins seem to work. I’ll keep looking around before I get too invested in DokuWiki to switch.

(2/8/2022) The problems with the Prosemirror WYSIWYG editor were from having the markdowku plugin installed, it confused editors which were meant to use DokuWiki notation. Disabling the Markdown plugin made things work much better. I also developed my own template and figured out how to set up a sidebar index/TOC that makes navigation easier. So I’m staying with DokuWiki for now.

Wiki Outline

I wanted to have a clickable and expandable table of contents for the entire wiki like other programs offer (Obsidian for example). The usual way to do this in DokuWiki is to use namespaces, which are just symbols separated from the document name by colons (category:document name). Some problems are, the names get really long to type and display and to reorganize the outline you have to edit all the names and links and change the namespace tags one-by-one – can’t just drag and drop or cut and paste a block of pages.

The way I decided to do this is to use a plugin called navi which builds a navigation menu from a bullet list instead of using the namespace structure. I put the bullet list in my start document so the full outline comes up first thing. I put the output of navi in my sidebar document with {{navi>start}} after some menu links.

The navi plugin gets the outline from the first bullet list it finds in the file but only includes entries that are links. So the whole outline has to be made of uncreated links. You also need to specify the link text on each link or the outline will use the lower case and dash versions of the file names. Luckily this is done automatically by the Prosemirror editor or it would be a lot more work.

If the full outline gets too long I’ll create some of the outline header documents and put the links to the individual files in them instead of in the start file.

Choosing A Theme

The navi plugin doesn’t work with most of the themes I liked unfortunately – the formatting of the outline text winds up weird. The default DokuWiki theme works as do a handful of others that are based on it. Of the working themes the one I liked best was GreenSteel, but it is too green for me. You can change the background color in the Template Style Settings but it only affect the bottom half – it uses a gradient image for the top.

Fixing Colors – Background and Links

First thing to fix was the background color choice. I just removed the image in the xxxx.css style file so the background is solid __background_site__ color. I would like to experiment with using css to make a gradient between two different colors, shouldn’t be too hard to add. I edited style.ini to put my own default values for the background and link colors – I don’t want to see red unless it’s an error.

Fixing Header Text Color

The title of the wiki in the header is coded #FFF color but the tagline under it is coded a darker fixed color. I changed the tagline to white also so it was visible at least but it should use one of the colors in the Template Style Settings. A lot of the header and footer text seems to be hard coded, but it should use variable color names. There are a bunch of choices in the Template Style Settings but it’s not clear how they are used – seems like a big redo is needed.

Finding Orphan Pages

I wanted an easy way to find all the unlinked (orphan) pages – other wikis have a built-in function and DokuWiki has a plugin. I installed the Display Orphans plugin, which will generate a list of orphans, needed pages, and linked pages by putting tags in a document:

Element Description
<<display orphaned>> Displays a table of orphaned pages, ie pages that exist but aren’t linked to.
<<display wanted>> Displays a table of wanted pages, ie pages that do not exist but are linked to.
<<display linked>> Displays a table of linked pages, ie pages that do exist and are linked to.

I created a page for each of these under the wiki: namespace so they wouldn’t show up in typical use, and put links to these special pages in my sidebar page. I’d rather have them in the heading with the rest of the Wiki Tools but since it depends on having a plugin installed it seemed like a user thing instead of a theme thing (maybe there is some way to finesse this?)

WYSIWYG Editor

I initially tried the Prosemirror WYSIWYG editor but I think the CKGEdit editor is much better. A lot of functions are missing from Prosemirror like monospaced text. The kama editor GUI style is the most compact – only two rows of smaller icons. I hid the font and text size menus because those should be determined by the theme – a wiki isn’t a word processor.