pre {
border-radius: 10px;
background-color: #fcffff
}
code {
color: #c72522;
font-size: 1.1em;
padding: 0.1em 0.3em;
border-radius: 0px;
}
.dokuwiki .aside {
font-size: 90%;
}
body {
font-size: 90%;
}
.dokuwiki div.breadcrumbs {
font-size: 90%;
}
See also [[#Dokuwiki Template monospace font]]
==== Dokuwiki Template Tagline ====
Try to learn something about everything, and everything about something
-Thomas Huxley “Darwin's bulldog” (1824-1895)
===== Dokuwiki Timezone =====
* I noticed the timestamps on file creation/modification were in UTC
* I'd rather have "local time" so I don't have to think too hard
* The answer is here -> [[https://www.dokuwiki.org/tips:timezone]]
* I used the first option, after successfully testing the second (editing ''php.ini'')
* I created ''conf/local.protected.php'' with
* I did ''sudo chown www-data:www-data local.protected.php'' too, just to be sure
* All looks good - pages created/modified while in //summer time// show the time in ''BST'' and pages modified in //winter time// show the time in ''GMT''
===== Add DW2PDF =====
- To allow export of pages from Wiki -> PDF format install plugin [[https://www.dokuwiki.org/plugin:dw2pdf|dw2pdf]]
- to enable functionality it was necessary to install ''php-mbstring'' package on the VPS
- sudo apt-get install php-mbstring
- sudo service apache2 restart
==== UPDATE====
--- //John Pumford-Green 26/04/23 10:04//
removed ''dw2pdf'' plugin, it is largely unused and adds pointless bloat.
===== Increase maximum file size upload for Media Manager =====
- edit ''php.ini''
- sudo vi /etc/php/XX/apache2/php.ini
- change ''upload_max_filesize = 2M'' to ''upload_max_filesize = 20M''
- change ''post_max_size = 2M'' to ''post_max_size = 20M''
- sudo service apache2 restart
===== Allow any file-type upload =====
From [[https://forum.dokuwiki.org/d/3318-allow-upload-of-any-filetype/5]]
Edit ''/var/www/html/www/dokuwiki/inc/media.php'' and comment out :
// because a temp file was created already
//if (!preg_match('/\.(' . $regex . ')$/i', $fn)) {
// return [$lang['uploadwrong'], -1];
//}
===== Acronyms & Abbreviations =====
I find the underlining and "explanation" of some abbreviations/acronyms by dokuwiki, when rendering a page, to be annoying.
The process is described [[https://www.dokuwiki.org/abbreviations | HERE ]]
To disable this I simply copied the default ''conf/acronyms.conf'' to a local version ''conf/acronyms.local.conf'' and then edited the ''local'' version to remove all the explanations.
# Acronyms.
ACL
AFAICS
AFAIK
AFAIR
API
ASAP
ASCII
BTW
CMS
CSS
DNS
EOF
EOL
EOM
EOT
FAQ
FTP
FOSS
FLOSS
FUD
FYI
GB
GHz
GPL
GUI
HTML
IANAL
IE
IIRC
IMHO
IMO
IOW
IRC
IRL
KISS
LAN
LGPL
LOL
MathML
MB
MHz
MSIE
OMG
OS
OSS
OTOH
PITA
RFC
ROTFL
RTFM
spec
TIA
TL;DR
TOC
URI
URL
W3C
WTF?
WYSIWYG
YMMV
This supresses the annoyance.
--- //John Pumford-Green 30/04/23 13:49//
===== Add folded plugin =====
make a clickable hide/reveal section with
%%
++++ visible text |
hidden text blah blah
++++
%%
e.g.
++++
There is a table here... |
^Col1^Col2^Col3^
|one|two|three|
def func():
print "hello world"
++++
===== Increase TAGCLOUD font size =====
edit ''/var/www/html/dokuwiki/lib/plugins/cloud/style.less''
increase ''size factor''
/* Size factor. */
@sF: 1.2;
force re-fresh of browser to show new font size.
===== Keyboard Plugin =====
* tweak the size, border and colour
=== example keys ===
C+'C'
=== Tweaks ===
''/var/www/html/dokuwiki/lib/plugins/keyboard/all.css''
kbd.__keyboard {
color: #0000ff;
background-color: #defede;
text-align: center;
border-left: 1px solid #cfcfcf;
border-top: 1px solid #cfcfcf;
border-right: 3px solid #666666;
border-bottom: 3px solid #666666;
-moz-border-radius: 4px 4px 4px 4px;
padding-left: 3px;
padding-top: 0px;
padding-right: 3px;
padding-bottom: 0px;
margin-left: 2px;
margin-right: 2px;
vertical-align: top;
font-family: sans-serif;
white-space: nowrap;
font-size: 1.2em;
}
===== Dokuwiki Template monospace font =====
* the colour of the mono font is the same as general text and doesn't stand out as well as in other templates.
* edit ''/var/www/html/dokuwiki/lib/tpl/dokuwiki/css/basic.less'' with a hex code for a better colour
* but see below for a better place to do the configuraiton
code {
color: #c72522;
font-size: 1.1em;
padding: 0.1em 0.3em;
border-radius: 0;
}
* To prevent upgrades overwriting these changes - add them to ''/var/www/html/dokuwiki/conf/userstyle.css''
* ''pre'' relates to the blocks of %% //////
%%
* ''code'' relates to ''monospaced text''
pre {
border-radius: 10px;
background-color: #fcffff
}
code {
color: #c72522;
font-size: 1.1em;
padding: 0.1em 0.3em;
border-radius: 0px;
}
===== Remove Dokuwiki template footer buttons =====
* edit ''/var/www/html/dokuwiki/lib/tpl/dokuwiki/tpl_footer.php''
* comment out ( %%%% ) the license stanza **and/or** the %%%% that contains the "buttons"
/conf'' called ''bootstrap3.themes.conf''
* ''chown www-data:www-data bootstrap3.themes.conf''
* add the required theme/namespace mapping:
# Namespace Bootswatch Theme
start bootswatch/darkly
public bootswatch/darkly
public:calculator bootswatch/slate
public:journal bootswatch/journal
private bootswatch/flatly
playground bootswatch/united
private:wire2waves bootswatch/paper
blog bootswatch/yeti
* it seems necessary to disable ''showThemeSwitcher'' and to select a default theme to be used outside of any listed in the conf file
===== Vector / Monobook tweaks =====
I like the Vector and Monobook templates, very similar feel to Wikipedia
==== Logout errors with later versions of Dokuwiki ====
After upgrading Dokuwiki to //Igor// it became impossible to log out due to a warning
Security Token did not match. Possible CSRF attack.
I initially ignored it but then downgraded back to //Hogfather// as there seemed to be no fix - other than to use a different template.
I recently upgraded to the latest Dokuwiki (Jack Jackrum), and upgraded all plugins and templates where possible. However the problem with logout with Vector and Monobook re-appeared.
I found there was a fix described on the forum:
[[https://forum.dokuwiki.org/d/20248-security-token-did-not-match-possible-csrf-attack-cannot-log-out]]
and the cure is to edit the appropriate line in ''main.php'' for each template, as the author seems not to be maintaining these templates any more, at least not the official ones accessed via Dokuwiki's Template/Extension installer. The github repository shows that the fix has been applied to ''Vector'', and a pull request submitted to fix ''Monobook'', the fixes haven't appeared in the official versions.
The FIXME does work, though...
For Vector edit ''/var/www/html/dokuwiki/lib/tpl/vector/main.php'' to add '', 'sectok' => getSecurityToken()'' in the ''array'' statement after ''"do" => "logout"''
echo " "logout", 'sectok' => getSecurityToken()))."\" rel=\"nofollow\">".hsc($lang["btn_logout"])." \n"; //language comes from DokuWiki core
and the same for ''Monobook''
echo " "logout", 'sectok' => getSecurityToken()))."\" rel=\"nofollow\">".hsc($lang["btn_logout"])." \n"; //language comes from DokuWiki core
==== Monospace font ====
I found the style applied to ''monospace'' text was a little underwhelming.
I found the place to change it:
'' /var/www/html/dokuwiki/lib/tpl/{vector|monobook}/user/screen.css ''
add the the following and adjust as needed:
div#content .dokuwiki code {
font-size: 100%;
padding-left: 5px;
padding-right: 5px;
background-color: #eee;
color: #00f;
direction: ltr;
text-align: left;
}
==== Footer Buttons ====
Remove the default footer buttons by editing ''{vector|monobook}/user/buttons.php'' and adding
For Monobook, change to $_monobook_btns = array();
//delete all (defaults)
$_vector_btns = array();
this suppresses the inclusion of footer buttons from ''vector/conf/buttons.php''
=== Add just the Dokuwiki and Vector/Monobook Buttons ===
Edit ''{vector|monobook}/user/buttons.php''
Swap ''monobook'' for ''vector'' as appropriate
==== Mobile Scaling ====
The layout on a phone isn't too good, and can't be zoomed/scaled.
I found this thread:
[[https://forum.dokuwiki.org/d/12469-vector-template-doesn-t-display-correctly-on-mobile-devices/6]]
and applied the comment-out of the line :
//echo "";
in ''main.php'' and ''mediamanager.php''
the page now scales/zooms okay to make it useable on a phone.
==== Alternative ====
** Using the ''loadskin'' plugin **
it's possible to switch to the default ''dokuwiki'' template when on a mobile device and the ''vector'' template when on a computer.
The ''loadskin'' plugin seems to lead to problems switching between ''monobook'' and ''vector'' - the **navigation sidebar** seems to disappear on one or the other. Not sure where the problem is.
===== Note Plugin =====
Various Coloured notes:
This is my note ! Remember it!!
Warning ! You're about to lose your mind ;-)
The clues are in the images.
Beware of the cat when you open the door !!
++++Note in a Folded section|
Ça fonctionne seulement avec le //div// pas le //span//.
++++
This is my note ! Remember it!!
Warning ! You're about to lose your mind ;-)
The clues are in the images.
Beware of the cat when you open the door !!
++++Note in a Folded section|
Ça fonctionne seulement avec le //div// pas le //span//.
++++
===== Monobook Tweaks =====
==== PDF Export Tab ====
The ''dw2pdf'' plugin provides a button on many templates to trigger export to ''PDF'' but not on ''monobook''. It's possible to add a tab to the top of the page, beside the ''edit'' etc. tabs, to do the the ''pdf export'' function.
add the following code to to ''monobook/user/tabs.php''
//PDF plugin: export tab
if (file_exists(DOKU_PLUGIN."dw2pdf/action.php") &&
!plugin_isdisabled("dw2pdf")){
$_monobook_tabs["tab-export-pdf"]["text"] = "pdf export";
$_monobook_tabs["tab-export-pdf"]["href"] = wl(getID(), array("do" => "export_pdf"), false, "&");
}
===== Vector Interwiki Icons =====
The icon shown on interwiki links almost always appears as a small "lock" rather than the correct icon
commenting out the ''.link-https'' section in ''/vector/static/3rd/vector/main-ltr.css'' stops this :
div#content a.external,
div#content a[href ^="gopher://"] {
background: url(static/3rd/vector/external-link-ltr-icon.png) center right no-repeat;
padding: 0 13px 0 0;
}
/*
div#content a[href ^="https://"],
.link-https {
background: url(static/3rd/vector/lock-icon.png) center right no-repeat;
padding: 0 13px 0 0;
}
*/
div#content a[href ^="mailto:"],
.link-mailto {
background: url(static/3rd/vector/mail-icon.png) center right no-repeat;
padding: 0 13px 0 0;
}
Page Updated: ~~LASTMOD~~
{{tag>dokuwiki}}
===== Bootstrap3 ThemeByNamespace =====
To force specific ''bootstrap/bootswatch'' themes dependant on the namespace
* enable ''ThemeByNamespace'' option
* create a file in ''