Table of Contents
CodeButton2 Plugin
Compatible with DokuWiki
Binky, Weatherwax, Adora Belle, Angua
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
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.
Prerequirements
PHP GD must be enabled.
In debian-based system install with
sudo apt-get install php5-gd
Syntax and Usage
- Go to Admin Panel → CodeButton2
- Add buttons in a INI file format following this syntax:
<button_name> = "<code_name>"
- Click “Save” button
- Now you will be able to see the code block and buttons at your toolbar
ScreenShots
Configuration
Result: new buttons in the toolbar
Troubleshooting
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); $btn.append($ico);
Configuration of PHP
Enable GD in PHP.