====== Markdown Plugin ====== ---- plugin ---- description: Enables you to write pages using the markdown syntax author : Carl-Christian Salvesen email : calle@ioslo.net type : syntax lastupdate : 2006-05-24 compatible : depends : conflicts : similar : markdowku, markdownextra tags : formatting, markup_language ---- * [[http://wiki.ioslo.net/dokuwiki/markdown|Details and Download]] (this link appears to be broken) * [[http://madpropellerhead.com/projects/markdownextra.tgz| Download alternative link]] * [[http://daringfireball.net/projects/markdown/|markdown syntax]] :!: ** Website With Plugin Currently Down ** Use one of the newer plugins [[markdownextra]] or [[markdowku]] instead. If you want to use the old markdown, you can download [[http://michelf.com/projects/php-markdown/|PHP Markdown]] and use the following syntax.php: ===== syntax.php ===== */ // must be run within DokuWiki if(!defined('DOKU_INC')) die(); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_PLUGIN.'syntax.php'); require_once(DOKU_PLUGIN.'markdown/markdown.php'); /** * All DokuWiki plugins to extend the parser/rendering mechanism * need to inherit from this class */ class syntax_plugin_markdown extends DokuWiki_Syntax_Plugin { /** * return some info */ function getInfo(){ return array( 'author' => 'Sebastian Siedentopf', 'email' => 'openmail@siezi.com', 'date' => '2008-08-28', 'name' => 'Markdown Plugin', 'desc' => 'Parses Markdown Bocks', 'url' => 'http://www.dokuwiki.org/plugin:markdown', ); } /** * What kind of syntax are we? */ function getType(){ return 'protected'; } /** * Where to sort in? */ function getSort(){ return 69; } function getPType() { return 'block'; } /** * Connect pattern to lexer */ function connectTo($mode) { $this->Lexer->addEntryPattern('(?=.*)',$mode,'plugin_markdown'); } function postConnect() { $this->Lexer->addExitPattern('','plugin_markdown'); } /** * Handle the match */ function handle($match, $state, $pos, &$handler){ return array($match); } /** * Create output */ function render($mode, &$renderer, $data) { if($mode == 'xhtml' && $data[0] != "" && $data[0] != "") { $renderer->doc .= Markdown($data[0]); return true; } return false; } } //Setup VIM: ex: et ts=4 enc=utf-8 : ?>