Changeset 3599 for trunk/manual/lib
- Timestamp:
- 01/23/08 16:37:39 (12 months ago)
- Location:
- trunk/manual/lib/Text/Wiki/Render
- Files:
-
- 2 modified
-
Latex/Code.php (modified) (3 diffs)
-
Xhtml/Code.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/manual/lib/Text/Wiki/Render/Latex/Code.php
r2308 r3599 2 2 3 3 class Text_Wiki_Render_Latex_Code extends Text_Wiki_Render { 4 5 4 5 6 6 /** 7 * 7 * 8 8 * Renders a token into text matching the requested format. 9 * 9 * 10 10 * @access public 11 * 11 * 12 12 * @param array $options The "options" portion of the token (second 13 13 * element). 14 * 14 * 15 15 * @return string The text rendered from the token options. 16 * 16 * 17 17 */ 18 18 19 19 function token($options) 20 20 { … … 22 22 $attr = $options['attr']; 23 23 $type = strtolower($attr['type']); 24 24 25 25 if ($type == 'php') { 26 26 if (substr($options['text'], 0, 5) != '<?php') { … … 30 30 } 31 31 } 32 33 $text = "\\begin{lstlisting} \n$text\n\\end{lstlisting}\n\n";34 32 33 $text = "\\begin{lstlisting}[caption={} {}]\n$text\n\\end{lstlisting}\n\n"; 34 35 35 if ($type != '') { 36 36 $text = "\\lstset{language=$type}\n" . $text; -
trunk/manual/lib/Text/Wiki/Render/Xhtml/Code.php
r2308 r3599 31 31 'css_php' => null, // class for PHP <code> 32 32 'css_html' => null, // class for HTML <code> 33 'css_filename' => null // class for optional filename <div> 33 'css_filename' => null, // class for optional filename <div> 34 'code_begin_callback' => null 34 35 ); 35 36 … … 48 49 49 50 function token($options) 50 { 51 { 51 52 $text = $options['text']; 52 53 $attr = $options['attr']; … … 105 106 } 106 107 108 $callback = $this->getConf('code_begin_callback'); 109 if ($callback) { 110 $text = call_user_func($callback) . $text; 111 } 112 107 113 return "\n$text\n\n"; 108 114 }