I’m currently using Version 0.9.8 of WP-Syntax. I thought I would quickly go over its usage. To use WP-Syntax just switch over to HTML mode from Visual mode. The reason you need to do this is because Visual mode will escape out our <pre> code. Also, if your code contains any &, <, or >, you will need to stay in HTML mode for the rest of the post, otherwise if you switch back to Visual mode, some of your code could get double escaped and not work. (i.e. &, <, or >). It might be easiest to write your post and add the code at the end.
There are 3 main options.
First, you have starting line number.
<pre lang=”php” line=”5″>
echo “test”;
</pre>
that would produce something like:
echo "test";
Second, you can specify whether the text is already escaped or not
<pre lang=”php” escaped=”true”>
<?php
echo "Hello";
?>
</pre>
Would produce:
<?php echo "Hello"; ?>
Lastly, and most important you have the lang attribute. This attribute tells WP-Syntax what language and syntax to use for highlighting code. It uses GeSHi – Generic Syntax Highlighter behind the scenes. I did a quick search for a list of what languages WP-Syntax supports and their respective lang attributes, but was unable to find one. So I compiled one and here it is.
The following languages are supported in the “lang” attribute:
#syntab { border: 1px solid #C0C0C0; padding: 0px; margin: 0px; border-collapse: collapse; }
#syntab td, #syntab th{ border-bottom: 1px solid #C0C0C0; padding: 5px; }