* skullY@EFnet #epic * * Copyright 2009 Zach White. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY ZACH WHITE ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL ZACH WHITE OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ if(!defined('DOKU_INC')) { define('DOKU_INC', realpath(dirname(__FILE__).'/../../../').'/'); } if (!defined('DOKU_LF')) { define ('DOKU_LF', "\n"); } if (!defined('DOKU_TAB')) { define ('DOKU_TAB', " "); } require_once DOKU_INC . 'inc/parser/renderer.php'; require_once DOKU_INC . 'inc/html.php'; class renderer_plugin_irc extends Doku_Renderer { var $info = array( 'cache' => false, // may the rendered result cached? 'toc' => false, // render the TOC? ); var $doc = ''; // will contain the whole document var $headers = array(); var $footnotes = array(); var $lastsec = 0; var $store = ''; function getFormat() { return 'irc'; } // This doesn't seem to get called... function document_start() { // Reset some internals $this->toc = array(); $this->headers = array(); // Set the proper HTTP headers header('Content-Type: text/plain'); } function header($text, $level, $pos) { // Write the header $this->doc .= ''.$text.''.DOKU_LF; } function cdata($text) { $this->doc .= $text; } function linebreak() { $this->doc .= DOKU_LF; } function p_close() { $this->doc .= DOKU_LF.DOKU_LF; } function hr() { $this->doc .= DOKU_LF; $this->doc .= '-'*78; $this->doc .= DOKU_LF; } function strong_open() { $this->doc .= ''; } function strong_close() { $this->doc .= ''; } function emphasis_open() { $this->doc .= ''; } function emphasis_close() { $this->doc .= ''; } function underline_open() { $this->doc .= ''; } function underline_close() { $this->doc .= ''; } function listu_open() { $this->doc .= DOKU_LF; } function listu_close() { $this->doc .= DOKU_LF; } function listo_close() { $this->doc .= DOKU_LF; } function listitem_open($level) { $this->doc .= ' * '; } function listitem_close() { $this->doc .= DOKU_LF; } function unformatted($text) { $this->doc .= $text; } function preformatted($text) { $this->doc .= $text.DOKU_LF; } function file($text) { $this->doc .= $text.DOKU_LF; } function quote_open() { $this->doc .= ' '; } function quote_close() { $this->doc .= DOKU_LF; } function tablerow_close(){ $this->doc .= DOKU_LF; } function tableheader_open($colspan = NULL, $align = NULL){ $this->doc .= ''; } function tableheader_close(){ $this->doc .= ''.DOKU_LF; } function tablecell_open($colspan = NULL, $align = NULL){ $this->doc .= ''; } function tablecell_close(){ $this->doc .= ''.DOKU_LF; } function acronym($acronym) { $this->doc .= $acronym; } function camelcaselink($link) { $this->internallink($link,$link); } function locallink($hash, $name = NULL){ if ($name === NULL) $name = $hash; $this->doc .= ''.$name.''; } function internallink($id, $name = NULL, $search=NULL, $returnonly=NULL) { if ($name === NULL) $name = $id; $this->doc .= ''.$name.''; } function externallink($url, $name = NULL) { if ($name === NULL) $name = $url; $this->doc .= ''.$name.''; } function emaillink($address, $name = NULL) { $this->doc .= ''.$address.''; } } ?>