User Tools

Site Tools


dokuwiki

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.js to the conf/ directory.
  • Create or update userscript.js to include ASCIIMathML.js.
/* DOKUWIKI:include ASCIIMathML.js */
  • Update local.php to disable JavaScript compression:
$conf['compress'] = 0;   // for ASCIIMathML.js

Tiny Diagram

Incorporating the Tiny Diagram JavaScript renderer requires the following changes:

  • Add diag to the list of formatting modes in inc/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 diag to the formatting modes in src/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.js to the conf/ directory.
  • Create or update userscript.js to include tinydiagram.js.
/* DOKUWIKI:include tinydiagram.js */
  • Dokuwiki tries to convert quotes to "smart quotes". This breaks the diagram JSON. Update local.php to disable quotation character conversion:
$conf['typography'] = 0; // for Tiny Diagram
dokuwiki.txt · Last modified: 2016/05/14 16:11 by javapimp