Crayon Syntax Highlighter – .reg Support
March 21st, 2012 | Tags: Syntax
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
Added {css}@import “reg.css”;{/css} after theme info:
|
1 2 3 4 5 6 7 8 |
/* Theme Name: Classic Description: Clean, crisp and colorful. Version: 1.3 Author: Aram Kocharyan Author URI: http://ak.net84.net/ */ @import "reg.css"; |
Added {css}reg reg{/css} to a new line at the end of the file:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 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 |
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
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
/* 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; } |
|
1 2 |
= : |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
### 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] @ |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
HKEY_LOCAL_MACHINE HKEY_CLASSES_ROOT HKEY_CURRENT_USER HKEY_USERS HKEY_CURRENT_CONFIG HKEY_DYN_DATA HKLM HKCR HKCU HKU HKCC HKDD |
|
1 2 |
dword hex |
|
1 2 |
Windows Registry Editor Version 5.00 REGEDIT4 |
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.
4 Comments
| discussion on “Crayon Syntax Highlighter – .reg Support”
Leave a Reply

Send a copy of your work to the Crayon dev at
http://ak.net84.net/projects/crayon-syntax-highlighter/
He will probably add your hard work to the main source trunk.
Can Crayon highlight VHDL? There is no option called “VHDL”, but I was wondering if it went under a different name?
I don’t believe so but you can try emailing the developer a request to add support for VHDL. You could also just try to add the support yourself using the files I created as a guide.