====== codepad Plugin ====== ---- plugin ---- description: Uses interpreters on codepad.org to execute sourcecode author : deshi email : type : syntax lastupdate : 2011-08-28 compatible : depends : conflicts : similar : tags : code downloadurl: # eg. https://github.com//dokuwiki-plugin-codepad/zipball/master bugtracker : # eg. https://github.com//dokuwiki-plugin-codepad/issues sourcerepo : # eg. https://github.com//dokuwiki-plugin-codepad/ donationurl: ---- ===== Installation ===== Install manually. =3 (http://www.gnu.org/licenses/) * @version 1.0.0 * @link http://www.dokuwiki.org/plugin:codepad */ if (!defined('DOKU_INC')) die(); if (!defined('DOKU_PLUGIN_CODEPAD')) define('DOKU_PLUGIN_CODEPAD',DOKU_PLUGIN.'codepad/'); 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, Doku_Handler $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, Doku_Renderer $renderer, $data) { global $conf; if($mode == 'xhtml'){ $renderer->doc .= '
'; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= '
'; $renderer->doc .= ' '; $renderer->doc .= '
'; $renderer->doc .= '
'; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= '
'; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= ' '; $renderer->doc .= '
'; $renderer->doc .= '
'; $renderer->doc .= '
'; $renderer->doc .= '
'; $renderer->doc .= '
'; return true; } return false; } } ?>
===== Examples/Usage ===== ~~codepad~~ ===== Syntax ===== ~~codepad~~ ===== Configuration and Settings ===== ===== Development ===== anyone === Change Log === * **2011-08-28** * Initial release === Known Bugs and Issues === none === ToDo/Wish List === ===== FAQ ===== ===== Discussion ===== //Could be placed on an external page (e.g. plugin:pluginname:discussion) to have a distinction between user comments and author docs//