It's better when it's simple

User Tools

Site Tools


CodeButton2 Plugin

Compatible with DokuWiki

Binky, Weatherwax, Adora Belle, Angua

plugin A plugin for adding custom code buttons into the toolbar with configuration, mix of codebutton_ext and custombuttons plugins. See screenshots below.

Last updated on

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to codebutton_ext, custombuttons

Tagged with button, code, deprecated, toolbar

:!: Need small javascript hacking in DokuWiki version since 2012-10-13 “Adora Belle”.

Download and Installation

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.


PHP GD must be enabled.

In debian-based system install with

sudo apt-get install php5-gd

Syntax and Usage

  1. Go to Admin Panel>CodeButton2
  2. Add buttons in a INI file format following this syntax:
    <button_name> = "<code_name>"
  3. Click save
  4. Now you will be able to see the code block and buttons at your toolbar



Result: new buttons in the toolbar


Configuration in genpng.php

On some installation relative path don't work. Configure absolute path to font you want to use in variable $font in file genpng.php.

$font = '/var/www/html/wiki/lib/plugins/codebutton2/DejaVuSans.ttf'; //path to font you want to use

Disable resizing icons in some DokuWiki releases

Some DokuWiki releases resize icons to 16×16 size. Just comment this resizing in /lib/scripts/edit.js (about line 40)

    // create the icon and add it to the button
    $ico.attr('src', icon);
    //Disable resizing icons
   // $ico.attr('width', 16);
   // $ico.attr('height', 16);

Configuration of PHP

Enable GD in PHP.

plugin/codebutton2.txt · Last modified: 2020-06-03 18:06 by benks

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki