svenbit / Markdown_Geshi

Adds GeSHi code highlighting to PHP Markdown.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Markdown_Geshi

A simple extension to the PHP Markdown implementation to add code highlighting to the wordpress plugin using GeSHi.

Installation

  • 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

Usage

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.

Example

#!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.

Troubleshooting

If you have any trouble using the plugin, please report an issue at github.com

About

Adds GeSHi code highlighting to PHP Markdown.