Plugins
Source Code syntax highlighting plugin for WordPress
by mahpour on Nov.03, 2006, under Plugins
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.
- Download Dean’s Code Highlighter v1.0 .
- unzip and upload the file into your wp-content/plugins/ directory.
- Activate the plugin on your Admin Panel->Plugin Management page.
- add the Code Container’s CSS classes to your style sheet.
- 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;
}