Prism is a syntax highlighter, written in JavaScript, and used on a many different websites (including this one!). It's probably most useful for documentation and technical blogs, where we have blocks of example code which can be made a lot more readable with some syntax highlighting. It can be downloaded with support for any of 56 languages (by my count, at the time of writing), and can be extended with additional language definitions.

Which is handy, since tcl isn't among those 56.

So as part of setting up this blog, I've had a go at writing a language definition file for syntax highlighting of tcl using prism. I've also created a jsFiddle to demo this code, and a pull request on github. I'm sure there's some room for improvement, but it should cope fairly well with the majority of cases, at least.

proc hello_world {} {
  # This proc puts "Hello, World"
  set text "Hello, World"
  if { true } {
    puts $text
  return ${text}