This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
fuss:dokuwiki [2016/10/28 14:13] – [Disable GeSHi Links] office | fuss:dokuwiki [2018/11/28 17:15] – [Upgrade Plugins for PHP 7 Compatibility] office | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Increase Timeout for Synchronization ====== | ||
+ | <code php> | ||
+ | $this-> | ||
+ | $this-> | ||
+ | </ | ||
+ | |||
+ | ====== Add GeSHi Coloring ====== | ||
+ | |||
+ | By default, dokuwiki uses only one template to render all the code highlighting. This is pretty restrictive given that GeSHi has language-specific highlighting. The guide on the [[https:// | ||
+ | |||
+ | |||
+ | ====== Batch-Edit Checked Boxes ====== | ||
+ | |||
+ | Add '' | ||
+ | |||
+ | <code php> | ||
+ | $this-> | ||
+ | </ | ||
+ | |||
+ | ====== Enable Tikz for the LaTeX Plugin ====== | ||
+ | |||
+ | The patch removes going through '' | ||
+ | |||
+ | <file diff class.latexrender.diff> | ||
+ | --- latex-original/ | ||
+ | +++ latex/ | ||
+ | @@ -51,16 +51,7 @@ | ||
+ | var $_font_size = 10; | ||
+ | var $_latexclass = " | ||
+ | var $_tmp_filename; | ||
+ | - // this most certainly needs to be extended. in the long term it is planned to use | ||
+ | - // a positive list for more security. this is hopefully enough for now. i'd be glad | ||
+ | - // to receive more bad tags ! | ||
+ | - var $_latex_tags_blacklist = array( | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - ); | ||
+ | + var $_latex_tags_blacklist = array(); | ||
+ | var $_errorcode = 0; | ||
+ | var $_errorextra = ""; | ||
+ | var $_filename; | ||
+ | @@ -240,18 +231,13 @@ | ||
+ | | ||
+ | } | ||
+ | |||
+ | - // convert dvi file to postscript using dvips | ||
+ | - | ||
+ | - | ||
+ | - | ||
+ | - | ||
+ | | ||
+ | - | ||
+ | + | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | - if ($status_dvips || $status_convert) { | ||
+ | + if ($status_convert) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ====== Disable GeSHi Links ====== | ||
+ | |||
+ | In '' | ||
+ | <code php> | ||
+ | var $keyword_links = true; | ||
+ | </ | ||
+ | |||
+ | to: | ||
+ | |||
+ | <code php> | ||
+ | var $keyword_links = false; | ||
+ | </ | ||
+ | |||
+ | ====== Preview Text Before Edit Form ====== | ||
+ | |||
+ | Dokuwiki by default places the form before the preview text. This seems a little inconvenient because you are meant to pay attention at what you have written at the bottom of the page, such the having the preview window with the last lines of text at the bottom instead of on top (before your eyes) is not helpful. The following patch: | ||
+ | |||
+ | <code diff> | ||
+ | --- template.php.old 2013-05-10 12: | ||
+ | +++ template.php 2013-09-03 04: | ||
+ | @@ -108,8 +108,8 @@ | ||
+ | | ||
+ | | ||
+ | case ' | ||
+ | - html_edit(); | ||
+ | | ||
+ | + html_edit(); | ||
+ | | ||
+ | case ' | ||
+ | | ||
+ | |||
+ | </ | ||
+ | |||
+ | reverses that behavior, by editing '' | ||
+ | |||
+ | ====== Split a Large Page into Sub-Pages ====== | ||
+ | |||
+ | The following PHP script reads a dokuwiki file (such as the ones under '' | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | |||
+ | ########################################################################### | ||
+ | ## Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 ## | ||
+ | ########################################################################### | ||
+ | ## This scans a dokuwiki page file and branches out all the top-level | ||
+ | ## sections into multiple files named after the title and normalized. | ||
+ | ########################################################################### | ||
+ | |||
+ | ########################################################################### | ||
+ | ## CONFIGURATION | ||
+ | ########################################################################### | ||
+ | |||
+ | # The dokuwiki file to scan. | ||
+ | $scan = ' | ||
+ | |||
+ | # In which directory to save the pages. | ||
+ | $directory = ' | ||
+ | |||
+ | ########################################################################### | ||
+ | ## | ||
+ | ########################################################################### | ||
+ | |||
+ | if(($handle = fopen($scan, | ||
+ | die; | ||
+ | |||
+ | # The normalization routines for Dokuwiki. | ||
+ | $pattern[0] = '/ | ||
+ | $replace[0] = ' | ||
+ | |||
+ | $pattern[1] = '/ | ||
+ | $replace[1] = ''; | ||
+ | |||
+ | # For every line in the dokuwiki document... | ||
+ | $fileName = ''; | ||
+ | $title = ''; | ||
+ | while (($line = fgets($handle)) !== false) { | ||
+ | # Check that we have a top-level section | ||
+ | switch(preg_match('/ | ||
+ | case TRUE: # if we do have a top-level section, normalize the title to a file-name... | ||
+ | $title = $matches[1]; | ||
+ | $fileName = strtolower( | ||
+ | preg_replace( | ||
+ | '/ | ||
+ | ' | ||
+ | preg_replace( | ||
+ | $pattern, | ||
+ | $replace, | ||
+ | $matches[1] | ||
+ | ) | ||
+ | ).' | ||
+ | ); | ||
+ | # and create the file. | ||
+ | if(touch($directory.'/' | ||
+ | $fileName = ''; | ||
+ | $title = ''; | ||
+ | break; | ||
+ | } | ||
+ | break; | ||
+ | default: | ||
+ | # if the file could not be created, skip | ||
+ | if($fileName == '' | ||
+ | # similarly, if the created file could not be opened in append mode then skip | ||
+ | if(($df = fopen($directory.'/' | ||
+ | switch($title) { | ||
+ | case '': | ||
+ | break; | ||
+ | default: | ||
+ | fwrite($df, | ||
+ | $title = ''; | ||
+ | break; | ||
+ | } | ||
+ | # and write the lines to the file | ||
+ | if(fwrite($df, | ||
+ | echo 'Error writing: ' | ||
+ | # close the temporary file | ||
+ | fclose($df); | ||
+ | break; | ||
+ | } | ||
+ | } | ||
+ | # close the dokuwiki document | ||
+ | fclose($handle); | ||
+ | |||
+ | ?> | ||
+ | </ | ||
+ | |||
+ | ====== Using Tikz with Dokuwiki LaTeX Plugin ====== | ||
+ | |||
+ | If you use Tikz with the Dokuwiki LaTeX plugin you may notice that it will generate very small images. This is due to the line: | ||
+ | < | ||
+ | $command = $this-> | ||
+ | </ | ||
+ | |||
+ | in '' | ||
+ | |||
+ | To remedy the situation, edit '' | ||
+ | < | ||
+ | $command = $this-> | ||
+ | </ | ||
+ | |||
+ | ====== Upgrade Plugins for PHP 7 Compatibility ====== | ||
+ | |||
+ | Change directory from the Dokuwiki root to '' | ||
+ | <code bash> | ||
+ | find . -type f -exec perl -p -i -e ' | ||
+ | </ | ||
+ | and: | ||
+ | <code bash> | ||
+ | find . -type f -exec perl -p -i -e ' | ||
+ | </ | ||
+ | |||
+ | ====== Password Recovery ====== | ||
+ | |||
+ | In case of a lost password, add the following line to '' | ||
+ | < | ||
+ | admin: | ||
+ | </ | ||
+ | |||
+ | and then login using the username '' |