Changeset 1651 for trunk/vendor/Text

Show
Ignore:
Timestamp:
06/12/07 23:18:21 (19 months ago)
Author:
jepso
Message:

New documentation tool.

Location:
trunk/vendor/Text/Wiki/Render/Xhtml
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/vendor/Text/Wiki/Render/Xhtml/Bold.php

    r1125 r1651  
    4747        if ($options['type'] == 'start') { 
    4848            $css = $this->formatConf(' class="%s"', 'css'); 
    49             return "<b$css>"; 
     49            return "<strong$css>"; 
    5050        } 
    5151 
    5252        if ($options['type'] == 'end') { 
    53             return '</b>'; 
     53            return '</strong>'; 
    5454        } 
    5555    } 
  • trunk/vendor/Text/Wiki/Render/Xhtml/Code.php

    r1162 r1651  
    6060 
    6161        if ($type == 'php') { 
     62 
    6263            if (substr($options['text'], 0, 5) != '<?php') { 
    6364                // PHP code example: 
    6465                // add the PHP tags 
    65                 $text = "<?php  
    66                 " .  $options['text'] . "\n?>"; // <?php 
     66                $text = "<?php \n"  
     67                      . $options['text'] . "\n\n" 
     68                      . "?>"; 
    6769            } 
    6870 
    6971            // convert tabs to four spaces 
    70             $text = str_replace("\t", "&nbsp;&nbsp;%nbsp;&nbsp;", $text); 
     72            $text = str_replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;", $text); 
    7173 
    7274            // colorize the code block (also converts HTML entities and adds 
    7375            // <code>...</code> tags) 
    74             $h = new PHP_Highlight; 
     76            $h = new PHP_Highlight(true); 
    7577            $h->loadString($text); 
    7678            $text = $h->toHtml(true); 
    77  
     79             
    7880            // replace <br /> tags with simple newlines. 
    7981            // replace non-breaking space with simple spaces. 
    8082            // translate HTML <font> and color to XHTML <span> and style. 
    8183            // courtesy of research by A. Kalin :-). 
    82             /** 
     84             
    8385            $map = array( 
    84                 '<br />'  => "\n", 
    85                 '&nbsp;'  => ' ', 
    86                 "\n"      => "<br \>", 
    87                 '<font'   => '<span', 
    88                 '</font>' => '</span>', 
    89                 'color="' => 'style="color:' 
     86                '&nbsp;'  => ' ' 
     87                //'<br />'  => "\n", 
     88                //"\n"      => "<br \>", 
     89                //'<font'   => '<span', 
     90                //'</font>' => '</span>', 
     91                //'color="' => 'style="color:' 
    9092            ); 
    91  
     93             
    9294            $text = strtr($text, $map); 
    93             */ 
    9495 
    9596            // get rid of the last newline inside the code block 
     
    105106 
    106107            // done 
    107             $text = "<table border=1 class='dashed' cellpadding=0 cellspacing=0> 
     108            /*$text = "<table border=1 class='dashed' cellpadding=0 cellspacing=0> 
    108109                     <tr><td><b>$text 
    109110                     </b></td></tr> 
    110                      </table>"; 
     111                     </table>";*/ 
    111112 
    112113        } elseif ($type == 'html' || $type == 'xhtml') { 
     
    117118            // convert entities. 
    118119            $text = str_replace("\t", "    ", $text); 
    119             $text = "<html>\n$text\n</html>"; 
     120            //$text = "<html>\n$text\n</html>"; 
    120121            $text = $this->textEncode($text); 
    121             $text = "<pre$css><code$css_html>$text</code></pre>"; 
     122            $text = "<pre$css>$text</pre>"; 
    122123 
    123124        } elseif ($type == 'sql') { 
     
    128129            $text = str_replace("\t", "    ", $text); 
    129130            $text = $this->textEncode($text); 
    130             $text = "<div class='sql'>$text</div>"; 
     131            $text = "<pre class=\"sql\">$text</pre>"; 
    131132        } else { 
    132133            // generic code example: 
     
    135136            $text = str_replace("\t", "    ", $text); 
    136137            $text = $this->textEncode($text); 
    137             $text = "<pre$css><code$css_code>$text</code></pre>"; 
     138            $text = "<pre$css>$text</pre>"; 
    138139        } 
    139140 
  • trunk/vendor/Text/Wiki/Render/Xhtml/Italic.php

    r1125 r1651  
    4747        if ($options['type'] == 'start') { 
    4848            $css = $this->formatConf(' class="%s"', 'css'); 
    49             return "<i$css>"; 
     49            return "<em$css>"; 
    5050        } 
    5151 
    5252        if ($options['type'] == 'end') { 
    53             return '</i>'; 
     53            return '</em>'; 
    5454        } 
    5555    } 
  • trunk/vendor/Text/Wiki/Render/Xhtml/Underline.php

    r1125 r1651  
    4747        if ($options['type'] == 'start') { 
    4848            $css = $this->formatConf(' class="%s"', 'css'); 
    49             return "<u$css>"; 
     49            return "<span style=\"text-decoration: underline;\"$css>"; 
    5050        } 
    5151 
    5252        if ($options['type'] == 'end') { 
    53             return '</u>'; 
     53            return '</span>'; 
    5454        } 
    5555    } 
  • trunk/vendor/Text/Wiki/Render/Xhtml/Url.php

    r1125 r1651  
    9494            $output = "<a$css href=\"$href\""; 
    9595 
     96            /* 
    9697            if ($target) { 
    9798                // use a "popup" window.  this is XHTML compliant, suggested by 
     
    101102                $output .= " return false;\""; 
    102103            } 
     104            */ 
    103105 
    104106            // finish up output