Crayon Syntax Highlighter – .reg Support

Download

After testing quite a few different syntax highlighting plugins for WordPress my personal favorite is the Crayon Syntax Highlighter even though there aren’t as many programming languages supported. The reason I chose this plugin is simply because of the control it gives me and because of this control it stood out against all of the other plugins I tested.

I was in need of .reg support for the code I posted in my Replacing notepad with Notepad++ article so I decided to code it myself. If you haven’t edited any of the plugins files then you can simply extract the reg.zip file into your “crayon-syntax-highlighter” plugins folder.

Files edited:
themes\classic\classic.css
langs\extensions.txt

[spoiler show=”classic.css” hide=”classic.css”]
Added {css}@import “reg.css”;{/css} after theme info:
[css title=”classic.css”]
/*
Theme Name: Classic
Description: Clean, crisp and colorful.
Version: 1.3
Author: Aram Kocharyan
Author URI: http://ak.net84.net/
*/
@import “reg.css”;
[/css][/spoiler]

[spoiler show=”extensions.css” hide=”extensions.css”]
Added {css}reg reg{/css} to a new line at the end of the file:
[css title=”extensions.css” mark=”16″]
# This file contains all the extensions mapped to their language IDs (folder names)
# Languages where names and extensions are the same do not need to be listed Eg PHP
# Languages that appear first in this list and share extensions will be given precedence

# Format: ID EXTENSION1 EXTENSION2

c# cs
c++ h hh hpp hxx h++ cc cpp cxx c++
html html htm xhtml xhtm xml xsd
java java class jar
objc m mm
python py pyw pyc pyo pyd
vb vbs
ruby rb rbx rhtml
as swf fla
reg reg
[/css][/spoiler]

Files added:
themes\classic\reg.css
langs\reg\operator.txt
langs\reg\reg.txt
langs\reg\rootkeys.txt
langs\reg\type.txt
langs\reg\version.txt

[spoiler show=”reg.css” hide=”reg.css”]
[css title=”reg.css”]
/* Custom Syntax Highlighting ============= */
.crayon-theme-classic .crayon-pre .regt {
color: #800080 !important;
}
.crayon-theme-classic .crayon-pre .regk {
color: #800000 !important;
}
.crayon-theme-classic .crayon-pre .rego {
color: #000 !important;
}
.crayon-theme-classic .crayon-pre .regc {
color: #009900 !important;
}
.crayon-theme-classic .crayon-pre .regva {
color: #0000FF !important;
}
.crayon-theme-classic .crayon-pre .regv {
color: #0000FF !important;
}
[/css][/spoiler]

[spoiler show=”operator.txt” hide=”operator.txt”]
[crayon title=”operator.txt”]
=
:
[/crayon][/spoiler]

[spoiler show=”reg.txt” hide=”reg.txt”]
[crayon title=”reg.txt”]
### SHELL LANGUAGE ###

# ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION

NAME Microsoft Registry
VERSION 5

HEADERVER [regv] \b(?alt:version.txt)
TYPE [regt] (hex\([02457b]\))|\b(?alt:type.txt)\b
ROOTKEYS [regk] \b(?alt:rootkeys.txt)\b
OPERATOR [rego] \b(?alt:operator.txt)\b
COMMENT [regc] (;.*?$)
VARIABLE [regva] @
[/crayon][/spoiler]

[spoiler show=”rootkeys.txt” hide=”rootkeys.txt”]
[crayon title=”rootkeys.txt”]
HKEY_LOCAL_MACHINE
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_USERS
HKEY_CURRENT_CONFIG
HKEY_DYN_DATA
HKLM
HKCR
HKCU
HKU
HKCC
HKDD
[/crayon][/spoiler]

[spoiler show=”type.txt” hide=”type.txt”]
[crayon title=”type.txt”]
dword
hex
[/crayon][/spoiler]

[spoiler show=”version.txt” hide=”version.txt”]
[crayon title=”version.txt”]
Windows Registry Editor Version 5.00
REGEDIT4
[/crayon][/spoiler]


UPDATE: When you update the Crayon Syntax Highlighter plugin all of the above changes will be erased. Each time you update the plugin you will have to re-add the .reg support.