/** * Construct */ public function __construct($baseUri) { parent::__construct(); // output $this->setOutputMode(self::HTML5); $this->htmlOutputModule->removeOptional = false; self::$advertisingNotice = false; // headings $this->headingModule->balancing = TexyHeadingModule::FIXED; // phrases $this->allowed['phrase/ins'] = true; // ++inserted++ $this->allowed['phrase/del'] = true; // --deleted-- $this->allowed['phrase/sup'] = true; // ^^superscript^^ $this->allowed['phrase/sub'] = true; // __subscript__ $this->allowed['phrase/cite'] = true; // ~~cite~~ $this->allowed['deprecated/codeswitch'] = true; // `=code // images $this->imageModule->fileRoot = WWW_DIR . "/files"; $this->imageModule->root = $baseUri . "/files/"; // flash, youtube.com, stream.cz, gravatar handlers $this->addHandler('image', array($this, 'youtubeHandler')); $this->addHandler('image', array($this, 'streamHandler')); $this->addHandler('image', array($this, 'flashHandler')); $this->addHandler("phrase", array($this, "netteLink")); $this->addHandler('image', array($this, 'gravatarHandler')); }
<?php /** * This demo shows how cache Texy! output and * demonstrates advantages of inheriting from base Texy object */ require_once dirname(__FILE__) . '/mytexy.php'; $texy = new MyTexy(); // processing $text = file_get_contents('sample.texy'); $html = $texy->process($text); // echo formated output header('Content-type: text/html; charset=utf-8'); echo '<title>' . $texy->headingModule->title . '</title>'; // echo $texy->time echo '<strong>' . number_format($texy->time, 3, ',', ' ') . 'sec</strong>'; echo '<br />'; // echo formated output echo $html; // echo HTML code echo '<hr />'; echo '<pre>'; echo htmlspecialchars($html); echo '</pre>';