{ I put this in Extension Development because it doesn't really fit elsewhere. }
After much research on something that would do proper Expression Engine syntax highlighting (much like the forums here offer), I found Chili, a jQuery plugin.
It was pretty simple to install and configure, though I use TinyMCE inside EE, and TinyMCE loves to cleanup code, sometimes in unwanted ways. This makes it challenging to include EE code snippets in the middle of a weblog entry.
However, I have it working. The problem is that the Chili “recipes”, as their called, or syntax highlight libraries do not include EE code. I set it to highlight EE code as if it is PHP, which highlights a bare minimum of it.
The syntax highlighting libraries look like this (a snip…)
, php: {
mlcom: {
_match: /\/\*[^*]*\*+([^\/][^*]*\*+)*\//
, _style: "color: gray;"
}
, com: {
_match: /(?:\/\/.*)|(?:[^\\]\#.*)/
, _style: "color: green;"
Lots of Regex. I think for an experienced developer, it would be a relatively trivial matter to make one for EE. You have to do some Regex along with entering a huge list of EE keywords so they will be highlighted properly.
Any takers? If someone does this, I will write a tutorial on how to put all the pieces together and implement syntax highlighting for EE weblog posts.
How about just using the GeSHIfy extension that is already available for ExpressionEngine?
I’ve used that on a site and really like the output that it gives. There’s quite a thread about it on these forums too.
Best wishes,
Mark
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.