Source Code syntax highlighting plugin for WordPress

Introduction

This plugin using Geshi to highlight source code in a wide range of popular languages,it aims to be a simple but powerful code highlighting plugin, with the following goals:

  • Easy to use
  • Support for a wide range of popular languages
  • Customizable output formats
  • Auto adjust the height of the Code Container if the code is too long

Installation

This plugin requires WordPress v.1.5 or later.

  1. Download Dean’s Code Highlighter v1.0 .
  2. unzip and upload the file into your wp-content/plugins/ directory.
  3. Activate the plugin on your Admin Panel->Plugin Management page.
  4. add the Code Container’s CSS classes to your style sheet.
  5. customize the output formats on Admin Panel->Options->Code Highlighter.

usage

Use the “pre” tag and add the programming language you want to use as a parameter. Example:. < pre lang="php" >your code here … < /pre >. for example:

< pre lang="php" > function hello_world(){ echo “hello world” } < /pre >after highlighting:

function hello_world(){ echo "hello world" }

Code Container Style

add the following CSS classes to your templates’s CSS file: .ch_code_container {
background-color: #f0f0f0;
border: 1px solid #C3CED9;
padding: 0px 0px 0 0;
width: 100%;
text-align: left;
font-size:1.00em;
overflow:auto;
}
.ch_code_container .head
{
color: #808080;
font-weight: bold;
background-color: #f0f0ff;
border-bottom: 1px solid #d0d0d0;
padding: 2px;
}

2 comments so far

  1. 622612015 January 6, 2008 12:50 pm

    622612015…

    622612015…

  2. efeito antabuse July 30, 2008 1:35 pm

    antabuse…

    herbs work like antabuse…

Leave a comment

Please be polite and on topic. Your e-mail will never be published.

You must be logged in to post a comment.