Skip to content

Instantly share code, notes, and snippets.

@kristi
Created July 25, 2011 07:40
Show Gist options
  • Save kristi/1103715 to your computer and use it in GitHub Desktop.
Save kristi/1103715 to your computer and use it in GitHub Desktop.
WP-Syntax Colorizer - Custom Geshi Colors
<?php
/*
Plugin Name: WP-Syntax Colorizer
Plugin URI: http://articles.akgfx.com/2008/04/wp-syntax-colorizer/
Description: A plugin allowing you to easily set all the WP-Syntax color settings in one place. WP-Syntax was developed by Ryan McGeary.
Author: Arash Keshmirian
Version: 0.1
Author URI: http://www.akgfx.com/
*/
add_action('wp_syntax_init_geshi', 'my_custom_geshi_styles');
function my_custom_geshi_styles(&$geshi)
{
//$geshi->enable_styles_and_classes();
//$geshi->enable_classes();
$geshi->set_overall_class('geshicode');
$geshi->set_overall_id('geshiid');
$geshi->set_tab_width(4);
$geshi->enable_keyword_links();
$geshi->set_methods_highlighting(true);
/*
* The following code has been tuned for PHP highlighting, and may require modifications
* to work with other languages.
*/
//$geshi->set_overall_style('color: #FFF;', true);
//$geshi->set_keyword_group_style(0, 'color: #B83A24;', true);
//$geshi->set_keyword_group_style(1, 'color: #B83A24;', true);
//$geshi->set_keyword_group_style(2, 'color: #577A61;', true);
$geshi->set_keyword_group_style(0, 'color: #729FCF;', true);
$geshi->set_keyword_group_style(1, 'color: #729FCF;', true);
$geshi->set_keyword_group_style(2, 'color: #729FCF;', true);
$geshi->set_keyword_group_style(3, 'color: #729FCF;', true);
$geshi->set_keyword_group_style(4, 'color: #35CECE;', false);
$geshi->set_methods_style(0, 'color: #35CECE;', false);
$geshi->set_methods_style(1, 'color: #35CECE;', false);
$geshi->set_methods_style(2, 'color: #35CECE;', false);
$geshi->set_methods_style(3, 'color: #35CECE;', false);
$geshi->set_methods_style(4, 'color: #35CECE;', false);
$geshi->set_strings_style('color: #AD7FA8;', true);
$geshi->set_symbols_style('color: #DDDDDD;', true);
$geshi->set_numbers_style('color: red;', true);
//$geshi->set_regexps_style(1,'color: blue;', true); // This color is ignored, but required.
$geshi->set_regexps_style(0,'color: #35CECF;', true);
$geshi->set_regexps_style(1,'color: #35CECF;', true);
$geshi->set_regexps_style(2,'color: #35CECF;', true);
$geshi->set_regexps_style(3,'color: #35CECF;', true);
$geshi->set_regexps_style(4,'color: #35CECF;', true);
$geshi->set_regexps_style(5,'color: #35CECF;', true);
$geshi->set_comments_style(0,' color: #81D962;', true);
$geshi->set_comments_style(1,' color: #81D962;', true);
$geshi->set_comments_style('MULTI',' color: #81D962;', true);
$geshi->set_symbols_style(' color: #053163;', false, 0);
$geshi->set_symbols_style(' color: #053163;', false, 1);
$geshi->set_symbols_style(' color: #053163;', false, 2);
$geshi->set_symbols_style(' color: #053163;', false, 3);
$geshi->set_symbols_style(' color: #053163;', false, 4);
//$geshi->enable_line_numbers(GESHI_FANCY_LINES, 2);
$geshi->set_line_style('background:#f00;', 'background:#00f;');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment