DokuWiki

From Omnia
Jump to navigation Jump to search

DokuWiki

Really really easy wiki to setup and use!

Manual

https://www.dokuwiki.org/manual

Download

https://download.dokuwiki.org/

Template Themes

DokuWiki's layout can be customized through templates (aka. skins or themes). https://www.dokuwiki.org/template

Install

# ubuntu
apt-get install apache2 php libapache2-mod-php php-mbstring php-xml imagemagick
# centos
yum install httpd php ImageMagick
#wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
#tar -zvxf dokuwiki-stable.tgz
#cd dokuwiki-2016*
wget https://download.dokuwiki.org/out/dokuwiki-c5525093cf2c4f47e2e5d2439fe13964.tgz -O dokuwiki.tgz
tar -zvxf dokuwiki.tgz
cd dokuwiki

Permissions:

# ubuntu
sudo chown -R www-data conf data
# centos
sudo chown -R apache conf data
# ubuntu
sudo chown -R www-data lib/plugins lib/tpl
# centos
sudo chown -R apache lib/plugins lib/tpl
# alt 1
find conf -type d -exec chmod g+s {} \;
find data -type d -exec chmod g+s {} \;
find lib/plugins -type d -exec chmod g+s {} \;
find lib/tpl -type d -exec chmod g+s {} \;
chown -R www-data conf data
# alt 2
# or really relaxed bad permissions
chmod -R o+w conf data
chmod -R o+w lib/plugins lib/tpl

Load install.php:

http://[host]/dokuwiki/install.php

After configuring, delete install.php:

# mv install.php install.php.disabled
rm install.php

Cleanup:

find . -name "_dummy" -exec rm {} \;
rm -rf data/pages/*

Apache

<VirtualHost *:80>
        ServerName doku.oeey.com

        DocumentRoot /www/dokuwiki

        <Directory /www/dokuwiki/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride all
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

Security

Reverse Heading Levels (Like Wikipedia)

install:permissions [DokuWiki] - https://www.dokuwiki.org/install:permissions

sudo chown -R apache conf data
sudo chown -R www-data conf data

Extension Manager:

sudo chown -R www-data lib/plugins

Theme Manager:

sudo chown -R www-data lib/tpl

Configure

http://doku.oeey.com/doku.php?id=start&do=admin&page=config

Basic:

  • Wiki title aka. your wiki's name: [wiki name]
  • Page name to use as the starting point for each namespace: "home"
    • Warning, this will be the default page for all namespaces!
  • Tagline (if template supports it): "my tagline"
  • Server URL: http://doku.oeey.com
  • dmode: 02775 (from 0755)
  • fmode: 0664 (from 0644)

Display:

  • Use hierarchical breadcrumbs (you probably want to disable the above option then): [X]
  • By default, DokuWiki will show all namespaces in the sitemap. [X]

Media:

  • Path to ImageMagick's convert tool: /usr/bin/convert

Editing:

  • htmlok - securityAllow embedded HTML [X]

Advanced:

  • Use nice URLs: .htaccess
  • Use slash as namespace separator in URLs: [X]

URL Rewriting

Enable rewrite:

# Ubuntu
<Directory /var/www/html>
    #Options Indexes FollowSymLinks MultiViews
    Options -Indexes -MultiViews +FollowSymLinks
    AllowOverride all
    Order allow,deny
    allow from all
</Directory>

rewrite [DokuWiki] - https://www.dokuwiki.org/rewrite

Turn:

http://example.com/doku.php?id=page

Into:

http://example.com/page

Directions:

  1. Go to Admin
  2. Open Configuration Manager
  3. Change Nice URLs option to .htaccess (use find, it's far down)
  4. Underneath it, check the option to “Use slash as namespace separator in URLs”
  5. .htaccess

doku folder:

# hidden file
cp .htaccess.dist .htaccess

Apache:

        <Directory />
                AllowOverride All
        </Directory>

.htaccess: (uncomment the following)

RewriteEngine on
 
RewriteRule ^_media/(.*)              lib/exe/fetch.php?media=$1  [QSA,L]
RewriteRule ^_detail/(.*)             lib/exe/detail.php?media=$1  [QSA,L]
RewriteRule ^_export/([^/]+)/(.*)     doku.php?do=export_$1&id=$2  [QSA,L]
RewriteRule ^$                        doku.php  [L]
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d
RewriteRule (.*)                      doku.php?id=$1  [QSA,L]
RewriteRule ^index.php$               doku.php

Formatting

Hello world

new\\
line

**bold**

//italics//

__underline__

<del>string-through</del>

''monospace''

''monospace\\
oooooooooo\\
iiiiiiiii''

<code>
monospace
oooooooooo
iiiiiiiii
</code>

<file>
monospace
oooooooooo
iiiiiiiii
</file>

====== Level 1 Headline ======

"=" = 7 - n

===== Level 2 Headline =====

==== Level 3 Headline ====

=== Level 4 Headline ===

== Level 5 Headline ==

horizontal rule:
----

[[test]]

[[test|internal page label]]

[[http://www.google.com|External Link]]

  - number item 1
  - number item 2

  * item 1
  * item 2

====== Images ======

Internal Image: (centered)\\
{{wiki:dokuwiki-128.png}}

Width:
{{wiki:dokuwiki-128.png?20}}

Height:
{{wiki:dokuwiki-128.png?0x20}}

WidthxHeight:
{{wiki:dokuwiki-128.png?30x20}}

External Image: (centered)\\
{{ https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png |Google Title}}

\\
\\
\\
\\

width 10 image:\\
{{ https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png?100|Google Title }}

Title:
{{image|title}}

By using left or right whitespaces you can choose left, right or center alignment.
{{image }}
{{ image}}
{{ image }}

Templates

template [DokuWiki] - https://www.dokuwiki.org/template

"DokuWiki's layout can be customized through templates (aka. skins or themes). "
  1. Just extract the downloaded template archive (usually a .zip or .tgz file) in the lib/tpl/ folder2).
  2. Then select the template in the Config Manager by adjusting the template option.

Bootstrap Simplified Template - BROKEN

BROKEN! Hasn't been updated in years! But look at typowiki, looks like a near exact replacement

Please clean and simple template.

cd lib/tpl
git clone https://github.com/badeendjuh/dokubootstrap-simplified.git dokubootstrapsimplified
chown -R  www-data dokubootstrapsimplified

typowiki Template

template:typowiki [DokuWiki]
https://www.dokuwiki.org/template:typowiki

Download - https://github.com/axlevxa/typowiki/releases/download/1.4/v1_4-typowiki.zip

Github - https://github.com/axlevxa/typowiki

This is a simple template in the modernist vein, which I have mixed feelings about. It is designed to match the look and feel people are familiar with and be comfy to read on a desktop or phone. It also is simpler to understand at-a-glance than some other templates.

raw Template

Minimal minimal template - like minimal!

template:raw [DokuWiki]
https://www.dokuwiki.org/template:raw

Github - https://github.com/rsnitsch/dokuwiki-template-raw

Install - Find in the module search or download at https://github.com/rsnitsch/dokuwiki-template-raw/archive/master.zip

The template focusses on the content such that the reader is not distracted by any other page elements. The wiki buttons (login, edit this page, latest changes etc.) are placed in the bottom right corner and they're almost invisible unless the mouse is move specifically to that corner.

Also, the template is supposed to be used for private websites (homepage etc.). For this reason, some of the wiki buttons are permanently disabled (invisible), e.g. recent changes.

If you want a search, add this to the bar__bottom in main.php:

<form><input type="hidden" name="do" value="search"><input name="q" type="text" value=""><button value="1" type="submit">Search</button></form>

Ad-Hominem Template

https://www.dokuwiki.org/template:ad-hominem
cd lib/tpl
wget https://github.com/saschaleib/dokuwiki-template-ad-hominem/archive/refs/tags/2023-09-09.zip
unzip 2023-09-09.zip
chown -R www-data dokuwiki-template-ad-hominem-2023-09-09

Not terrible. The section editor at least highlights the section.

Hydrogen Template

https://www.dokuwiki.org/template:hydrogen
cd lib/tpl
wget https://si3t.ch/pub/dokuwiki-themes/hydrogen.zip
unzip hydrogen.zip
chown -R www-data  hydrogen

I like this one a lot.

Mikio Template

Wide screen and clean. Very customizable options.

https://www.dokuwiki.org/template:mikio
cd lib/tpl
wget https://github.com/nomadjimbob/mikio/zipball/master
unzip master
chown -R www-data nomadjimbob-mikio-9b58a44

Name Spaces

namespaces [DokuWiki] - https://www.dokuwiki.org/namespaces

Use ":" to separate name spaces

TODO: find out how to do '/' name spaces? done - see next

Use slash for namespace

you can use this option additionally to use a slash instead of a colon as namespace separator in URLs.

config:useslash [DokuWiki] - https://www.dokuwiki.org/config:useslash

Bread Crumbs

Navigation Breakcrumbs (for name spaces)

breadcrumbs [DokuWiki] - https://www.dokuwiki.org/breadcrumbs

Name Space Table of Contents

See #Table of Contents Plugin

Plugins

Table of Contents Plugin

plugin:nspages [DokuWiki]
https://www.dokuwiki.org/plugin:nspages
<nspages>
<nspages NAMESPACE>
<nspages NAMESPACE -textPages="some text">   # instead of "Pages in this namespace"
  -nbCol=1  # change colums used, default is 3

Install:

Use the embedded plugin manager, or...
cd doku/lib/plugins
wget https://github.com/gturri/nspages/zipball/master -O nspages.zip
unzip nspages.zip
mv gturri-nspages-2a76987 nspages

MRedirect Plugin

Redirection plugin - any page containing nothing but a standard link will auto-redirect instantaneously

plugin:mredirect [DokuWiki] - https://github.com/M0rtenB/dokuwiki-mredirect/zipball/master

cd doku/lib/plugins
wget https://github.com/M0rtenB/dokuwiki-mredirect/zipball/master -O mredirect.zip
unzip mredirect.zip
mv M0rtenB-dokuwiki-mredirect-7dd0287 mredirect

Tag Plugin

Assign category tags to wiki pages

Examples:

    {{tag>tag1 tag2 tag3}}
    with namespaces: {{tag>ns1:tag1 ns1:tag2 ns2:subns1:tag3}}
    mutiple word tags: {{tag>tag1_with_multiple_words tag2 tag3_part}}
cd doku/lib/plugins
wget https://github.com/dokufreaks/plugin-tag/tarball/master -O tag.tar.gz
tar -zvxf tag.tar.gz
mv dokufreaks-plugin-tag-92d6176 tag

plugin:tag [DokuWiki] - https://www.dokuwiki.org/plugin:tag

Reverse Headings

https://www.dokuwiki.org/plugin:creole

Changes:

  • Listblock
  • Reverse Headings
  • Linebreaks (dokuwiki linebreaks are correct in creole 1.0)
  • Preformatted
  • Tables
  • Subscript
  • Superscript
  • Monospace
cd doku/lib/plugins
wget https://github.com/dokufreaks/plugin-creole/zipball/master -O creole.zip
tar -zvxf creole.zip
mv dokufreaks-plugin-creole-f36bf24 creole

Markup precedence (after installing Creole)

Settings: (my suggestions)

Markup precedence: Creole
Monospace behaviour: Use  tag
Replace a linebreak with: Linebreak

References:

CAPTCHA

plugin:captcha [DokuWiki] - https://www.dokuwiki.org/plugin:captcha

cd doku/lib/plugins
wget https://github.com/splitbrain/dokuwiki-plugin-captcha/zipball/master -O captcha.zip
tar -zvxf captcha.zip
mv captcha-* captcha

Markdown Plugin

plugin:markdowku [DokuWiki]
https://www.dokuwiki.org/plugin:markdowku

Section Editing

Move the Section Edit Button!

https://www.dokuwiki.org/plugin:editsections2

The “editsections” plugin moves edit section buttons up to the heading they belongs to. Configurable for nested (hierarchical) or flat edit sections. Nested edit sections cover the same indentation level as their heading.

Note: "If you prefer having your edit button beside the header, see the plugin editsections2"

Hacks

Hide Footer

Edit dokuwiki/lib/tpl/dokuwiki/tpl_footer.php

<!--
<div class="buttons">
...
</div>
-->

or

empty the tpl_footer.php file

http://www.inmotionhosting.com/support/edu/dokuwiki/change-dokuwiki-appearance/removing-footer-buttons-text

Hide Last modified

Comment out the tpl_pageinfo() call in the appropriate template file

# lib/tpl/bootie/main.php - line 112

<?php //tpl_pageinfo() ?>

Disabled Old Revisions

Disable the button in the config

  • Disable DokuWiki actions - Old revisions

Old revisions will still be generated, but won't be accessible.

To disable generation of old revisions, comment out the io_writeWikiPage in the function saveOldRevision():

inc/common.php
1370c1370
<     io_writeWikiPage($newf, rawWiki($id), $id, $date);
---
>     //io_writeWikiPage($newf, rawWiki($id), $id, $date);

Issues

utf8_encode is not available

PHP function utf8_encode is not available. Maybe your hosting provider disabled it for some reason

Test:

php -r 'print utf8_encode("fooo");'

References:

Invalid command RewriteEngine

.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

# ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
sudo a2enmod rewrite && sudo service apache2 restart

apache - .htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration - Stack Overflow - http://stackoverflow.com/questions/10144634/htaccess-invalid-command-rewriteengine-perhaps-misspelled-or-defined-by-a-m

keywords

dokuwiki wiki document crm