A simple extension to the PHP Markdown implementation to add code highlighting to the wordpress plugin using GeSHi.
- Install the PHP Markdown plugin
- Install the wp-syntax plugin
- Download the markdown-geshi.php file in your plugin folder
- Enable all three plugins and you're good to go
The highlighter is triggered by adding a 'shebang' to the code block. The shebang follows the following syntax:
#!lang@123
code to be highlighted
lang
is a language to use for highlighting and 123
is a line number
to start the numbering with.
#!php@12
while(true)
echo "Infinite time...!";
Would render the code starting at while
and starting with line number
12.
The line number is optional. If omitted, the lines will not be numbered.
If the shebang is omitted, the standard code block handler from the Markdown_Parser class is used.
If you have any trouble using the plugin, please report an issue at github.com