Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Adds GeSHi code highlighting to PHP Markdown.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 README.markdown
Octocat-spinner-32 markdown-geshi.php
README.markdown

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

Something went wrong with that request. Please try again.