dokuwiki
This is an old revision of the document!
Table of Contents
Syntax Highlighting
Changes to style in language file has no effect. Dokuwiki uses a single stylesheet for all languages. Comment out the following line in parserutils.php to disable.
... 760 // $geshi->enable_classes(); ...
ASCIIMathML.js
Incorporating ASCIIMathML.js requires disabling JavaScript compression in the configuration settings.
- Copy
ASCIIMathML.jsto theconf/directory. - Create or update
userscript.jsto includeASCIIMathML.js.
/* DOKUWIKI:include ASCIIMathML.js */
- Update
local.phpto disable JavaScript compression:
$conf['compress'] = 0; // for ASCIIMathML.js
Tiny Diagram
Incorporating the Tiny Diagram JavaScript renderer requires the following changes:
- Add
diagto the list of formatting modes ininc/parserutils.php.
// add formatting modes $fmt_modes = array('strong','emphasis','underline','monospace','diag', 'subscript','superscript','deleted');
- Add the following function to
inc/parser/handler.php.
function diag($match, $state, $pos) { $this->_nestingTag($match, $state, $pos, 'diag'); return true; }
- Add the following functions to
/inc/parser/xhtml.php.
/** * Start diag formatting */ function diag_open() { $this->doc .= '<div class="diag">'; } /** * Stop diag formatting */ function diag_close() { $this->doc .= '</div>'; }
- Add
diagto theformattingmodes insrc/parser/parser.php.
// modes for styling text -- footnote behaves similar to styling 'formatting' => array('strong', 'emphasis', 'underline', 'monospace','diag', 'subscript', 'superscript', 'deleted', 'footnote'),
- and the following entry in the formatting array:
'diag'=> array ( 'entry'=>'<diag>(?=.*</diag>)', 'exit'=>'</diag>', 'sort'=>140 ),
- Add the following functions to
inc/parser/renderer.php.
/** * Start diag formatting */ function diag_open() { } /** * Stop diag formatting */ function diag_close() { }
- Copy
tinydiagram.jsto theconf/directory. - Create or update
userscript.jsto includetinydiagram.js.
/* DOKUWIKI:include tinydiagram.js */
- Dokuwiki tries to convert quotes to "smart quotes". This breaks the diagram JSON. Update
local.phpto disable quotation character conversion:
$conf['typography'] = 0; // for Tiny Diagram
dokuwiki.1463260285.txt.gz · Last modified: 2023/08/18 18:15 (external edit)