Monday, July 9, 2007

Mako Highlighter for Komodo Edit

Update: I have recently moved blogs, and the download for the Mako highlighter has moved. It can be downloaded here.

I have been using Komodo Edit for my web development at work. I'm really beginning to like it. The JavaScript and HTML code completion and linter help me a lot, and the python support is very nice. Plus it has VI key bindings that actually work decently! I've also been playing around with Pylons and Mako more and more but, unfortunately, there is no Mako highlighter for Komodo.

So I sat down Sunday night and started hacking, and a few hours later I had a working Mako highlighter. At first it was a bit daunting, but a blog post by Eric Primislow, from Active State, made things a bit easier. If you are interested in making a code highlighter for Komodo, I highly recommend his post.

I figured that someone else might be able to use this, so I have posted the initial release here (v 0.1.1). All of the highlighting seems to work in my templates, and basic code folding works for most of the template items, except for the Python blocks.

There are still a few areas that could use some improvement. I hope to have better folding soon. I have figured out how to add HTML and CSS auto completion for the templates, but I haven't figured out how to have it automatically installed yet. It would also be nice to add some templates and code snippets as well.

If you use it, please leave me a comment, and please let me know if you find any problems or have any suggestions.

9 comments:

Angie said...

Comment from Christian Lean:

Thank you for this, I have found it quite useful. I noticed that it doesn't highlight strings properly though, when you have something like this:
${ "" }
then the second " doesn't highlight correctly. It happens with all types of quotes.

Angie said...

Comment from Chuck:

Hi Christian,

Thanks for the input. The way the highlighter is set up at the moment, it switches to Python highlighting, so it is going to highlight however you have string highlighting set up for the Python highlighting settings.

Chuck

Angie said...

Comment from Christian Lean:

If I have the following three things in the same template the problem only occurs in the third one. The problem seems to be with the ${ } and not with the , which has correct highlighting even in the same file with the same highlighting.





${ h.link_to("Return to list", h.url(action="list")) }

Angie said...

Comment from Christian Lean:

Sorry, it butchered my post, it should have been:





${ h.link_to("Return to list", h.url(action="list")) }

Angie said...

Comment from Christian Lean:

Lets try this:



${ h.link_to("Return to list", h.url(action="list")) }

JoeMoon said...

Hello,

I'm interested in your Mako syntax highlighter for Komodo, but unfortunately the link is dead.

Chuck said...

Hi Joe,

I apologize for that.. I have recently switched blogs and some of the links have broken. I have updated the post with a link to the installer at the top.

JoeMoon said...

Thank you for your quick response and also for releasing this publicly. So far it looks great, I'll let you know if I have any feedback.

Chuck said...

Hey Joe,

I'm glad it is working out for you. If you have any feed back, feel free to email me at cthier at gmail dot com.