Code Highlighting with Mephisto
December 28th, 2006
All the cool people have syntax highlighters and I want to be cool so I looked around for a good highlighter for mephisto. Dan Webb’s Plugin looked neat so I installed that. The included regular expressions for ruby were leaving out symbols and instance vars but this guy had a patch for that which apparently is already in the trunk version. You will have to create your own css.
# Here's some example's
def initialize(args)
@polarity = args[:polarity]
@actions = args[:actions]
@decider = args[:decider]
end
# Nice
oooooh = "aaaaah"
module Syntax
class Color
def smile
puts ":)"
end
def frown
puts ":("
end
end
end
Syntax::Color.new.smile
As you can see it’s not perfect yet but it’s better than nothing. Just a few lines of javascript regexp can simulate Matt’s 8000 line parser, sort of.
on December 30th, 2006 at 04:20 AM Nice theme.