About This Rule Parse Configuration Keys Render Configuration Keys Description
===== About This Rule =====
| **Name** | code |
| **Type** | capturing block |
| **Syntax** plain | '''' on a line by itself at the beginning of the line, followed by content block, followed by '''' on a line by itself at the beginning of the line |
| **Syntax** with type | ''...'' 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 | The CSS class to use for the
tag that wraps around the tags. |
| ''Xhtml'' | ''css_code'' | string | The CSS class to use for the tag when no code type is specified. |
| ''Xhtml'' | ''css_php'' | string | The CSS class to use for the tag when type="php". |
| ''Xhtml'' | ''css_html'' | string | The CSS class to use for the tag when type="html". |
===== Description =====
Use this rule to mark a generic code example. Text inside the code block will be treated as preformatted and monospaced. This markup:
line 1
line 2
... 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 tags around it. For example, this markup ...
// comment
$variable = 'Hello world!';
echo($variable);
... generates this output:
// comment
$variable = 'Hello world!';
echo($variable);
Similarly, this specifying HTML code like this...
A paragraph
and line break.
Generates this output (note the tags):
A paragraph
and line break.
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.