Table of Contents

About This Rule Parse Configuration Keys Render Configuration Keys Description

About This Rule

Name code
Type capturing block
Syntax plain <code> on a line by itself at the beginning of the line, followed by content block, followed by </code> on a line by itself at the beginning of the line
Syntax with type <code type="type">…</code> to indicate the type of code; e.g., type="PHP" or type="HTML"

Parse Configuration Keys

None.

Render Configuration Keys

Format Key Type Description
Xhtml css string

</code>… will generate this output:


line 1
line 2

If you specify a type of PHP, Text_Wiki will colorize the code for you and print <?php … ?> tags around it. For example, this markup …


 <code type="php">
 // comment
 $variable = 'Hello world!';
 echo($variable);
 

</code>… generates this output:

 
// comment
$variable = 'Hello world!';
echo($variable);

Similarly, this specifying HTML code like this…


 <code type="html">
 <!-- comment -->
 <p>A paragraph <br /> and line break.</p>
 

</code>Generates this output (note the <html> tags):

 
<!-- comment -->
<p>A paragraph <br /> and line break.</p>

You can specify any code type you like, e.g. "shell", but tags are added only to PHP and HTML code, and colorization only occurs for PHP code. Others may be added later.