DokuWiki: Difference between revisions
Line 399: | Line 399: | ||
tar -zvxf captcha.zip | tar -zvxf captcha.zip | ||
mv captcha-* captcha | mv captcha-* captcha | ||
=== Markdown Plugin === | |||
plugin:markdowku [DokuWiki] | |||
https://www.dokuwiki.org/plugin:markdowku | |||
=== Section Editing === | === Section Editing === |
Revision as of 19:24, 3 February 2024
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:
- Go to Admin
- Open Configuration Manager
- Change Nice URLs option to .htaccess (use find, it's far down)
- Underneath it, check the option to “Use slash as namespace separator in URLs”
- .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). "
- Just extract the downloaded template archive (usually a .zip or .tgz file) in the lib/tpl/ folder2).
- Then select the template in the Config Manager by adjusting the template option.
Bootie
Bootstrap Simplified Template
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
Plugins
Table of Contents Plugin
plugin:nspages [DokuWiki] - https://www.dokuwiki.org/plugin:nspages
<nspages> <nspages pagename>
Install:
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:
- faq:reverse_headers [DokuWiki] - https://www.dokuwiki.org/faq:reverse_headers
- I'd like to reverse the header syntax.
- It's possible to reverse the header syntax by using the creole plugin
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
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
Edit dokuwiki/lib/tpl/dokuwiki/tpl_footer.php
<!-- <div class="buttons"> ... </div> -->
or
empty the tpl_footer.php file
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:
- DokuWiki's installer says utf8_encode and utf8_decode are not available, any ideas how to fix this? : PHP - https://www.reddit.com/r/PHP/comments/39b68u/dokuwikis_installer_says_utf8_encode_and_utf8/
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