How to build Dean Lee’s Syntax Highlighter from latest components

Ron Fredericks writes: In my last two posts:

During my research to solve the word wrap problem, I discovered a few more issues leading me to update Dean’s plugin with the latest version of GeSHI (an open-source project: Generic Syntax Highlighter for php. Highlight many languages, including PHP, CSS, HTML, SQL, Java, Assembler, and C for XHTML compliant output) and removal of unused files. I thought other WordPress bloggers might like to take advantage of the latest code too, so I document the steps needed to build a clean plugin with the latest components.

Flow Chart / Swim Lanes Widget
Below is a Flash widget I built to document the steps needed so you can roll your own up-to-date plugin. Follow these steps and you won’t have to be a programmer to get the benefits from the latest versions of these program components. The widget actively links to the latest PHP files and CSS classes:

[flash w=450 h=583]

Why Roll Your Own Plugin?
I have been working with components and tools on various projects long enough to realize a common problem. Whenever components are used from different projects, such as Dean’s plugin integrated with the GeSHi language components, each file and/or component continues to receive bug fixes and enhancements in real-time without regard to the other components and files. This is natural because each component’s project is managed by a different group.

So now I have an idea on how to fix this evolving problem of diverging code bases: create a flow-chart showing how to assemble the individual components into a final product. Use swim-lanes to highlight the different component resources being used. Document the whole work-flow into a Flash document so links to other web pages and/or live video’s can be included as hot-links to demonstrate the process.

Detailed Notes on the Problems Solved Here
Here are the issues I solve in this blog post:

  • The version of GeSHi included with Dean’s code-base is now obsolete. The latest version of GeSHi includes a few bug fixes and a few new supported languages for syntax highlighting. By the time you read this blog post, perhaps GeSHi will have yet an even more improved and stable code base.
  • One of the optional modules supplied by GeSHi, PHP samples found in the “contrib” directory; include a recently-identified security risk if included on a web server – such as your WordPress blog installation. Dean’s plugin includes this GeSHi directory by default.
  • Dean’s plugin also includes a Mac temporary file called .DS_Store that is not used by WordPress either.

The Components and Their Versions
Dean’s original code has the following versions:

My rebuilt version of Dean’s plugin has the following components and version detail:

A Final Note
The GeSHi code base continues to go through updates. At some point the logic behind my approach – mix and match the latest code from all resources required for Dean’s WordPress plugin – might break down. Perhaps GeSHi will adopt a new interface that’s not suitable to Dean’s WordPress plugin code, for example. In any case, if you are having trouble getting Dean’s plugin to work, I suggest the following:

Revert back to Dean’s complete code base. Install it as he suggests and try it. If Dean’s original code base does not work, then maybe you are not following the install instructions correctly or perhaps WordPress itself is at an incompatible version. If the plugin works, then try replacing code one step at a time. With each new file change, try your updated WordPress plugin to see if it still can be deactivated, reactivated, and highlights code correctly in a blog post. When the offending component has been identified, let me know so we can work out a new swim-lane diagram for others to follow.

Technorati Tags: , , , , , , , , , , , ,

8 Responses to “How to build Dean Lee’s Syntax Highlighter from latest components”

  1. yqwvcewism Says:

    Hello! Good Site! Thanks you! xdqlfgouwcli

  2. The Third Bit » Blog Archive » I’m Behind the Curve Again Says:

    […] This post from Ron Fredericks includes a custom Flash widget flowcharting the steps required to get a particular WordPress plugin working — some of the bubbles in the flowchart are “live”, in that you can click them and jump to the appropriate places.  Very neat… […]

  3. ketan Says:

    can you sue this in PHP?

  4. Ron Fredericks Says:

    Hi Ketan:

    Indeed you can use this in PHP. You can find all the details you need from the GeSHi open-source project located here:

    Best regards

  5. Best Folding Chair Says:

    Amazing post.
    I hope you will check out my website..

  6. chat lexapro Says:

    lexapro compared lexapro v.

  7. music Says:

    very interesting.
    i’m adding in RSS Reader

  8. ??? ??? ?? Says:

    ??? ??? ??

    Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components

Leave a Reply