We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Request: Syntax highlighting library for "Chili" jQuery plugin

Development and Programming

Versa Studio's avatar
Versa Studio
572 posts
16 years ago
Versa Studio's avatar Versa Studio

{ 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.

http://noteslog.com/chili/

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.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

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

       
Versa Studio's avatar
Versa Studio
572 posts
16 years ago
Versa Studio's avatar Versa Studio

Mark,

I tried it, but no luck. It’s possible, though, the the problem was with TinyMCE instead of GeSHIfy.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.