Omeka Play Date: ColorCodeSyntaxHighlighting Plugin

Today Patrick Murray-John, Omeka Director of Developer Outreach, is visiting Virginia Tech and hosting Omeka technical sessions and play dates along with Amanda French.

I’ve had a desire to learn more about Omeka for a while, as a pathway to work on interesting digital humanities projects. Today I dug up an experimental hack project that I put together in September, the  ColorCodeSyntaxHighlighting plugin.

The ColorCodeSyntaxHighlighting Plugin for Omeka displays computer source code files inline on Omeka item pages, and performs color syntax highlighting similar to what you might find in your IDE.

perl_highlight.png

The plugin is configurable for font size of the displayed code, as well as color syntax highlighting style preference.

color_code_highlight_configure

This is an experimental, alpha-level version of the software, prototyped as a weekend hack by an Omeka first-timer with no recent PHP or front-end experience, and there are known bugs, or large problems to be worked out before making a production version. Many of the bugs are due to lack of JQuery knowledge. The most severe bug is that the plugin cannot properly display PHP code. The second most severe known bug is that code enclosed in <> angle brackets, such as in C++ standard library includes and C++ template syntax,  does not display, because it is interpreted as an html tag by the browser.

Syntax highlighting is provided by highlight.js. Currently, the plugin is only configured for a few file types (or computer languages), but it can be extended to support most of the 141 languages supported by highlight.js.

The initial experimental version of the plugin is available on GitHub. Tinkerers and contributors are welcome.

Code is ubiquitous, and it may not be long before libraries and museums need special tools to create exhibits based around code. Having code display facilities such as color syntax highlighting is one first step.

A next, and more exciting step, would be to take the work that Internet Archive is doing with MESS and MAME and plug that environment into Omeka and other archival systems to allow “antique” code to be executed from within those environments.

 

Advertisements

One thought on “Omeka Play Date: ColorCodeSyntaxHighlighting Plugin

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s