How to build Dean Lee’s Syntax Highlighter from latest components
Ron Fredericks writes: In my last two posts:
- I discovered Dean Lee’s Code Highlighter plugin for WordPress as the blogging solution for my source code display needs.
- I fixed a word wrap problem in Dean’s plugin.
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 https://www.embeddedcomponents.com/wp-content/uploads/2007/05/how2installplugin.swf 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:
- WordPress should be version 1.5 or later
- Dean’s Code Highlighter v1.1
- Download link:
www.deanlee.cn/wordpress/code_highlighter_plugin_for_wordpress/ - Dean’s code includes the following GeSHi components:
geshi.php, contrib and geshi directories
GESHI_VERSION, 1.0.7.14 - CSS classes for WordPress template style.css file
www.deanlee.cn/wordpress/code_highlighter_plugin_for_wordpress/#ch_css_class
My rebuilt version of Dean’s plugin has the following components and version detail:
- I’m using Worpress version 2.0.4
- Deans_code_highlighter.php
Version 1.1
Download link:
www.deanlee.cn/wordpress/code_highlighter_plugin_for_wordpress/ - geshi.php, and geshi directory
GESHI_VERSION, 1.0.7.19
Download link:
sourceforge.net/projects/geshi/ - New CSS classes for WordPress template style.css file
Version 1.0 from Embedded Components
www.embeddedcomponents.com/2007/05/how-to-fix-dean-lees-source-code-highlight-plugin/#ch_css_class
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: Ron Fredericks, Dean Lee, Code Highlighter, WordPress, plugin, component, Flow Chart, Swim Lanes, Flash, widget, PHP, CSS, GeSHi
July 31st, 2007 at 3:01 pm
Hello! Good Site! Thanks you! xdqlfgouwcli
July 31st, 2007 at 3:02 pm
[…] 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… […]
September 25th, 2007 at 2:58 am
can you sue this in PHP?
September 25th, 2007 at 2:02 pm
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: http://qbnz.com/highlighter/
Best regards
December 22nd, 2007 at 12:35 am
Amazing post.
I hope you will check out my website..
Thanks
January 6th, 2008 at 4:06 pm
lexapro compared lexapro v.
January 6th, 2008 at 5:19 pm
very interesting.
i’m adding in RSS Reader
January 1st, 2020 at 9:31 pm
??? ??? ??
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
February 12th, 2020 at 12:55 am
http://www.markhortours.com link for more info
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
February 27th, 2020 at 8:38 pm
?? ??? ??
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
March 5th, 2020 at 2:30 pm
?? ?????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
March 5th, 2020 at 11:16 pm
??? ???
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
April 3rd, 2020 at 12:45 am
?????????????????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
April 6th, 2020 at 9:55 am
??????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
April 15th, 2020 at 3:29 pm
??????????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
April 24th, 2020 at 7:25 pm
???????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
April 28th, 2020 at 2:02 pm
SM???
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
May 2nd, 2020 at 6:02 pm
Iammadein.com write an article
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
May 7th, 2020 at 3:39 am
???????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
May 11th, 2020 at 4:03 pm
007?????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
May 14th, 2020 at 6:26 pm
Napolin Accident Injury Lawyer
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
May 14th, 2020 at 6:47 pm
Ontario Lyft Accident Lawyer
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
May 14th, 2020 at 7:31 pm
Going at Tech Intheheadline
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
May 19th, 2020 at 1:05 pm
Ontario Auto Accident
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
May 19th, 2020 at 3:56 pm
?????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
May 22nd, 2020 at 12:58 pm
??????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
June 22nd, 2020 at 1:36 pm
??????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
June 26th, 2020 at 6:18 pm
???????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
July 18th, 2020 at 12:47 am
??????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
August 17th, 2020 at 7:20 am
??????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
September 8th, 2020 at 5:43 pm
??????????
Embedded Components and Tools Blog Center » Blog Archive » How to build Dean Lee’s Syntax Highlighter from latest components
October 7th, 2020 at 2:26 pm
We wish to thank you again for the wonderful ideas you gave Jeremy
when preparing her own post-graduate research and, most importantly, pertaining to providing each of the ideas in one blog post.
If we had been aware of your site a year ago, i’d have
been saved the unwanted measures we were employing. Thank you very much.