/** * Create a new highlighter instance for the given format. * * We use a factory so you can return different objects/classes * per format. * * @param string $format Output format (pdf, xhtml, troff, ...) * * @return PhDHighlighter Highlighter object */ public static function factory($format) { if ($format != 'xhtml') { return parent::factory($format); } return new self(); }
/** * Create a new highlighter instance for the given format. * * We use a factory so you can return different objects/classes * per format. * * @param string $format Output format (pdf, xhtml, troff, ...) * * @return PhDHighlighter Highlighter object */ public static function factory($format) { if ($format != 'xhtml' && $format != 'troff') { return parent::factory($format); } if ($format == 'troff') { $rendererclass = 'GeSHiRendererTroff'; } else { $rendererclass = 'GeSHiRendererHTML'; } require_once GESHI_CLASSES_ROOT . 'class.geshirenderer.php'; require_once GESHI_CLASSES_ROOT . 'renderers/class.' . strtolower($rendererclass) . '.php'; $rendererclass = '\\' . $rendererclass; $renderer = new $rendererclass(); return new self($renderer); }