This is an old revision of the document!
Table of Contents
codepad Plugin
Compatible with DokuWiki
No compatibility info given!
The missing download url means that this extension cannot be installed via the Extension Manager. Please see Publishing a Plugin on dokuwiki.org. Recommended are public repository hosts like GitHub, GitLab or Bitbucket.
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Installation
Install manually.
codepad\syntax.php
<?php /** * Plugin barcode: 2D-Barcode Implementation * @author Enrico Croce & Simona Burzio (staff@eiroca.net) * @copyright Copyright (C) 2009-2011 eIrOcA - Enrico Croce & Simona Burzio * @license GPL >=3 (http://www.gnu.org/licenses/) * @version 1.0.2 * @link http://www.eiroca.net */ if (!defined('DOKU_INC')) die(); if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); if (!defined('DOKU_PLUGIN_CODEPAD')) define('DOKU_PLUGIN_CODEPAD',DOKU_PLUGIN.'codepad/'); require_once (DOKU_PLUGIN.'syntax.php'); class syntax_plugin_codepad extends DokuWiki_Syntax_Plugin { function getType() { return 'substition'; } function getPType() { return 'normal'; } function getSort() { return 999; } function connectTo($mode) { $this->Lexer->addSpecialPattern('~~codepad~~', $mode, 'plugin_codepad'); //$this->Lexer->addSpecialPattern('~~codepad.*?~~', $mode, 'plugin_codepad'); } function handle($match, $state, $pos, &$handler) { $match_array = array(); //strip ~~codepad: from start and ~~ from end $match = substr($match,10,-2); // split parameters // $match_array = explode(",", $match); // $match_array[0] will be language return $match_array; } /** * Create output */ function render($mode, &$renderer, $data) { global $conf; if($mode == 'xhtml'){ $renderer->doc .= '<form action="http://codepad.org/" method="post" target=_blank>'; $renderer->doc .= ' <table width="100%" cellpadding="10">'; $renderer->doc .= ' <tbody>'; $renderer->doc .= ' <tr>'; $renderer->doc .= ' <td style="vertical-align: middle;"><textarea id="textarea" name="code" style="width: 100%;" rows="15" wrap="off"></textarea></td>'; $renderer->doc .= ' </tr>'; $renderer->doc .= ' <tr>'; $renderer->doc .= ' <td colspan="2" style="vertical-align: middle; text-align: right;">'; $renderer->doc .= ' <table width="100%" cellpadding="0" cellspacing="0"><tbody><tr>'; $renderer->doc .= ' <td style="text-align: right;">'; $renderer->doc .= ' <div style="float: right">'; $renderer->doc .= ' <table><tbody><tr>'; $renderer->doc .= ' <td>'; $renderer->doc .= ' <label style="margin-right:1em">'; $renderer->doc .= ' <input style="vertical-align: middle;" name="private" value="True" checked="checked" type="checkbox"><span style="vertical-align:middle" class="label">privat</span>'; $renderer->doc .= ' </label>'; $renderer->doc .= ' </td>'; $renderer->doc .= ' <td>'; $renderer->doc .= ' <label style="margin-right:1em">'; $renderer->doc .= ' <input style="vertical-align: middle;" name="run" value="True" checked="checked" type="checkbox"><span style="vertical-align:middle" class="label">Quellcode ausführen</span>'; $renderer->doc .= ' </label>'; $renderer->doc .= ' </td>'; $renderer->doc .= ' <td>'; $renderer->doc .= ' <label style="margin-right:1em">'; $renderer->doc .= ' <select id="lang" name="lang" style="vertical-align:middle"><option value="C">C</option><option value="C++">C++</option><option selected="selected" value="PHP">PHP</option></select>'; $renderer->doc .= ' </td>'; $renderer->doc .= ' <td style="text-align: right;">'; $renderer->doc .= ' <input name="submit" value="ausführen" type="submit">'; $renderer->doc .= ' </td>'; $renderer->doc .= ' </tr></tbody></table>'; $renderer->doc .= ' </div>'; $renderer->doc .= ' </td></tr></tbody></table>'; $renderer->doc .= ' </td>'; $renderer->doc .= ' </tr>'; $renderer->doc .= ' </tbody></table>'; $renderer->doc .= ' </form>'; return true; } return false; } } ?>
Examples/Usage
[Most people learn by example, so this goes first]
See the plugin in action here. The sample page shows all the styles available with the plugin.
A simple box:
<box> the box contents </box>
Some more complex boxes
<box 80% round orange|a title> the box contents</box> <box 50% left blue>the box contents</box|a caption> <box 60% round #f99 #fc9 #fcc #f60|title>the box contents></box|caption>
[Pictures showing the rendered result will help users to understand]
Syntax
[Complete syntax]
Basic syntax:
{{actionlink>action|title}}
- action can be one of this:
- edit — edit/create/show
- history — old revisions
Configuration and Settings
[also CSS style tips]
Development
[downloadable blocks, development comments]
Change Log
[preferable GitHub RSS feed or similar]
- 2009-01-01
- Initial release
Known Bugs and Issues
[this section might not be needed in case of external bug manager, or use RSS feed]
ToDo/Wish List
[developers roadmap]
FAQ
[discussions should ideally be deleted and turned into FAQ entries along the way]
Discussion
Could be placed on an external page (e.g. plugin:pluginname:discussion) to have a distinction between user comments and author docs